-
Notifications
You must be signed in to change notification settings - Fork 201
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
Get span.current().getSpanContext() in Azure eventhub consumer returning empty span context #1892
Comments
@imdad-ms
We're working on solving issues with Span.current() in reactor callbacks. To my best knowledge, they affect event hub consumers much less than producers, so I hope we can find mitigation while the proper fix is on the way. Thanks! |
A repo is here:
We are not seeing any correlationid from the below code - or actually, it's showing up as all "0"s.. We adorned the Web REST controller with similar code --- see the repro repo for the details, and there too in the Web REST controller context we get all "0"s too. my internal is scicoria public String getCorrelationId() {
Span current = null;
SpanContext context = null;
String traceid = null;
current = Span.current();
if (null != current)
context = current.getSpanContext();
if (null != current && null != context)
traceid = context.getTraceId();
return traceid;
// return Span.current() != null && Span.current().getSpanContext() != null ? Span.current().getSpanContext().getTraceId() : null;
// Span.current()
// PropagatedSpan@231 "PropagatedSpan{ImmutableSpanContext{traceId=00000000000000000000000000000000,
//spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}}"
} |
FYI, we missed setting the I believe this issue can be closed.
|
3.2.0-BETA.4 was just released, and this option is now enabled by default, so no need to remember to set it anymore 👍 |
Expected behavior
Describe what you expected to happen.
var context = Span.current() != null && Span.current().getSpanContext() != null ? Span.current().getSpanContext().getTraceId() : null;
Actual behavior
returning default empty span context
To Reproduce
Steps to reproduce the behavior:
var spanContext = getCurrentSpanContext();
Sample Application
If applicable, provide a sample application which reproduces the issue.
System information
Please provide the following information:
Logs
Turn on SDK logs and attach/paste them to the issue. If using an application server, also attach any relevant server logs.
Logs can be provided if required.
Be sure to remove any private information from the logs before posting!
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: