Skip to content

Commit 797e279

Browse files
authored
Updating context propagation spec (#464)
1 parent 25e8c6c commit 797e279

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

specs/agents/tracing-spans.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,14 @@ This can help to drop nested HTTP spans for instrumented calls that use HTTP as
120120

121121
#### Context propagation
122122

123-
As a general rule, when agents are tracing an exit span where the downstream service is known not to continue the trace,
124-
they SHOULD NOT propagate the trace context via the underlying protocol.
123+
When tracing an exit span, agents SHOULD propagate the trace context via the underlying protocol wherever possible.
125124

126-
Example: for Elasticsearch requests, which use HTTP as the transport, agents should not add `traceparent` headers to the outgoing HTTP request.
127-
However, when tracing a regular outgoing HTTP request (one that's not initiated by an exit span),
128-
and it's unknown whether the downsteam service continues the trace,
129-
the trace headers should be added.
125+
Example: for Elasticsearch requests, which use HTTP as the transport, agents SHOULD add `traceparent` headers to the outgoing HTTP request.
130126

131-
The reason is that spans cannot be [compressed](handling-huge-traces/tracing-spans-compress.md) if the context has been propagated, as it may lead to orphaned transactions.
132-
That means that the `parent.id` of a transaction may refer to a span that's not available because it has been compressed (merged with another span).
133-
134-
There can, however, be exceptions to this rule whenever it makes sense. For example, if it's known that the backend system can continue the trace.
127+
This means that such spans cannot be [compressed](handling-huge-traces/tracing-spans-compress.md) if the context has
128+
been propagated, because the `parent.id` of the downstream transaction may refer to a span that's not available.
129+
For now, the implication would be the inability to compress HTTP spans. Should we decide to enable that in the future,
130+
following are two options how to do that:
131+
- Add a denylist of span `type` and/or `subtype` to identify exit spans of which underlying protocol supports context propagation by default.
132+
For example, such list could contain `type == storage, subtype == s3`, preventing context propagation at S3 queries, even though those rely on HTTP/S.
133+
- Add a list of child IDs to compressed exit spans that can be used when looking up `parent.id` of downstream transactions.

0 commit comments

Comments
 (0)