You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/agents/tracing-spans.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,15 +120,14 @@ This can help to drop nested HTTP spans for instrumented calls that use HTTP as
120
120
121
121
#### Context propagation
122
122
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.
125
124
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.
130
126
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