-
Notifications
You must be signed in to change notification settings - Fork 872
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
Verify and update jaeger and zipkin exporters for error code handling. #2272
Comments
I can get stuck into this one for a good second issue 👍🏼 |
I am assuming for this, I am more specifically looking at the |
So, for brevity, clarity and future reference I'll condense all of the details on this issue with regards to my findings. JaegerThe error handling has been detailed in the
Jaeger-gRPCThis has been consistently implemented in the following code: if (span.getStatus().getStatusCode() == StatusCode.ERROR) {
target.addTags(toKeyValue(KEY_ERROR, true));
} Jaeger-ThriftThe same has been done in the if (span.getStatus().getStatusCode() == StatusCode.ERROR) {
tags.add(toTag(KEY_ERROR, true));
} ZipkinThe Error handling has been detailed in the
Zipkin exporterIt seems that the code doesn't exactly do what the specification mandates. The specification says that the description field is only set IF there is an error. Additionally, it doesn't say to use the if (!status.isUnset()) {
spanBuilder.putTag(OTEL_STATUS_CODE, status.getStatusCode().toString());
if (status.getDescription() != null) {
spanBuilder.putTag(OTEL_STATUS_DESCRIPTION, status.getDescription());
}
} I have got extra questions around this as I believe there is a slight inconsistency between the Lastly, depending on if there are any updates in the specifications on the back of my queries, the code I've referenced above may need to change slightly with regards to the description condition being moved inside an |
Have had a response back to my query, it seems that there are some variances within the So on the back of the above, it seems that the The Zipkin specification says that the
The // include status code & description.
if (!status.isUnset()) {
spanBuilder.putTag(OTEL_STATUS_CODE, status.getStatusCode().toString());
if (status.getDescription() != null) {
spanBuilder.putTag(OTEL_STATUS_DESCRIPTION, status.getDescription());
}
}
// add the error tag, if it isn't already in the source span.
if (!status.isOk() && spanAttributes.get(STATUS_ERROR) == null) {
spanBuilder.putTag(STATUS_ERROR.getKey(), status.getStatusCode().toString());
} So it essentially sets both the I believe the changes we have to make to make sure this adheres to the // include status code & error.
if (!status.isUnset()) {
spanBuilder.putTag(OTEL_STATUS_CODE, status.getStatusCode().toString());
// add the error tag, if it isn't already in the source span.
if (!status.isOk() && spanAttributes.get(STATUS_ERROR) == null) {
spanBuilder.putTag(STATUS_ERROR.getKey(), getValueOrReturnEmpty(status.getDescription()));
}
}
...
private static String getValueOrReturnEmpty(String value) {
return value != null ? value : "";
} Welcome your thoughts 👍 |
@ChrisJBurns Thanks for the summary, that proposed change seems good to me |
This PR in the specs updated how span errors should be handled in jaeger & zipkin: open-telemetry/opentelemetry-specification#1257
We should verify that our code is doing what it should and update it if it isn't.
The text was updated successfully, but these errors were encountered: