Skip to content
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

Otel bridge transaction not picking correct transaction.result #4389

Open
achyut-tokekar opened this issue Dec 26, 2024 · 0 comments
Open

Otel bridge transaction not picking correct transaction.result #4389

achyut-tokekar opened this issue Dec 26, 2024 · 0 comments

Comments

@achyut-tokekar
Copy link

When using custom Otel instrumentation we're setting span.setStatus as

span.setStatus({
     code: 2,
});

since code 2 is for error in transaction result it should be failure but transaction.result is always coming as success.

Upon further debugging looks like in here otelSpanStatus is expecting number.

And as per docs in opentelemetry (and also in their interface), we are expecting to send object with key as code
https://opentelemetry.io/docs/languages/js/instrumentation/#recording-exceptions

Attaching screenshots of a Request having 500 status code but in transaction.result it was still success
Image
Image

NOTE: We're using elastic as backend and open-telemetry-bridge enabled

We've added this as a patch for now

 const statusCodeStartNumber = res.statusCode.toString().charAt(0);
 span._span._agent.currentTransaction._result = `HTTP ${statusCodeStartNumber}xx`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant