1
1
[[features]]
2
2
= Features
3
3
4
+ [[features_accessing-reactor-context-values]]
4
5
== Accessing reactor context values
5
6
6
7
In the callbacks, `ValueSource` contains a reactor's `ContextView` object under `ContextView.class` key.
@@ -18,6 +19,7 @@ public void beforeQuery(QueryExecutionInfo execInfo) {
18
19
}
19
20
----
20
21
22
+ [[features_available-contextview-scopes]]
21
23
=== Available ContextView scopes
22
24
23
25
While interacting with R2DBC APIs, there are multiple places that could put values into the reactor contexts.
@@ -94,6 +96,18 @@ Since the dependency is optional, users need to explicit add the `micrometer-obs
94
96
For Spring Boot 3, a separate project, _TBD_, provides auto-configuration for this.
95
97
96
98
include::../../../target/observation-docs//_conventions.adoc[]
99
+ [IMPORTANT]
100
+ .Virtual Thread Environment
101
+ ====
102
+ The default `QueryObservationConvention` includes the thread name as a low-cardinality tag in spans.
103
+
104
+ In a virtual thread environment, each thread has a unique name.
105
+ As a result, tagging thread names as a low-cardinality key-value can lead to cardinality explosion in tracing backends.
106
+
107
+ To avoid this, use `VirtualThreadQueryObservationConvention`, a subclass of `QueryObservationConvention`, which omits the thread name tag.
108
+ This convention is recommended when running in a virtual thread environment.
109
+ ====
110
+
97
111
include::../../../target/observation-docs/_metrics.adoc[]
98
112
include::../../../target/observation-docs/_spans.adoc[]
99
113
0 commit comments