Skip to content

Commit cd14571

Browse files
committed
Document about VirtualThreadQueryObservationConvention
Relates #149
1 parent a0bd641 commit cd14571

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/asciidoc/features.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[[features]]
22
= Features
33

4+
[[features_accessing-reactor-context-values]]
45
== Accessing reactor context values
56

67
In the callbacks, `ValueSource` contains a reactor's `ContextView` object under `ContextView.class` key.
@@ -18,6 +19,7 @@ public void beforeQuery(QueryExecutionInfo execInfo) {
1819
}
1920
----
2021

22+
[[features_available-contextview-scopes]]
2123
=== Available ContextView scopes
2224

2325
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
9496
For Spring Boot 3, a separate project, _TBD_, provides auto-configuration for this.
9597

9698
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+
97111
include::../../../target/observation-docs/_metrics.adoc[]
98112
include::../../../target/observation-docs/_spans.adoc[]
99113

0 commit comments

Comments
 (0)