-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Providing Parent in X-Amzn-Trace-Id results in no spans being exported #649
Comments
FYI @NathanielRN |
I continued playing with this last night and was able to get this to work by adding I'd refine my bug report, as
|
Thanks for providing this additional context @andrew-matteson ! It's very helpful 😄
I looks like you are correct, if Lines 154 to 158 in 6f96577
This behavior is consistent with what is done in other languages such as in the OTel Java AWS X-Ray Propagator or in OTel JS AWS X-Ray Propagator. Your use case makes sense, however I'm not sure if sampling by default is what most users would want. Maybe we can make documentation about this better in the meantime.
I think based on your configuration, the behavior you saw was expected. In your code you are using class TracerProvider(trace_api.TracerProvider):
"""See `opentelemetry.trace.TracerProvider`."""
def __init__(
self,
sampler: sampling.Sampler = _TRACE_SAMPLER, The default def _get_from_env_or_default() -> Sampler:
trace_sampler = os.getenv(
OTEL_TRACES_SAMPLER, "parentbased_always_on"
).lower() which will always sample unless the Parent is present to say otherwise: DEFAULT_ON = ParentBased(ALWAYS_ON)
"""Sampler that respects its parent span's sampling decision, but otherwise always samples.""" So in your 2nd case, when you add the Parent header, your But to unblock you for now I would suggest using Please let me know if that makes sense! |
@NathanielRN Thank you! Makes complete sense. I'm unblocked at this point. Your doc suggestion sounds like the way to go. |
There's a good chance this is user error. If so, I'd appreciate a pointer to the relevant doc.
Describe your environment
Steps to reproduce
Using this sample application:
Calling:
curl 'http://localhost:8000/foo'
produces a span that is exported by my collector to X-Ray.Calling:
curl 'http://localhost:8000/foo' -H 'X-Amzn-Trace-Id: Root=1-612fa749-271fa48e4c544863a13425d5;Parent=86153bfee2237b3b'
does not export a span.What is the expected behavior?
My frontend application is producing requests with
X-Amzn-Trace-Id
in the format above. The frontend is separately sending X-Ray data. I'm expecting the trace ID generated by the frontend to be the root of the of the server segment so I can correlate the frontend activity and the backend activity.What is the actual behavior?
When providing the header from the frontend, no span is generated by the backend. The frontend succeeds in generating spans that I see in the X-Ray console. No backend segments are seen.
Additional context
Unsure if #445 is related. It's the only thing that I could find in the issues that might be.
The text was updated successfully, but these errors were encountered: