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

Stack trace for "Can not execute the operation on ended Span" log #5105

Closed
1 of 2 tasks
neilfordyce opened this issue Nov 1, 2024 · 3 comments
Closed
1 of 2 tasks
Labels

Comments

@neilfordyce
Copy link
Contributor

I'm looking into multiple services producing Can not execute the operation on ended Span logs from this line:

`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`

We have some theories about libraries and bits of instrumentation that might be broken. However, given the information available it's difficult to confidently pinpoint the source. Would it be reasonable to add a stack trace to that log? That way we'll be able to tell what instrumentation is trying to add to the ended span.

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first
@pichlermarc
Copy link
Member

Hi @neilfordyce thanks for reaching out. I think attaching a stack trace to that log is a great idea. 👍

I wonder though: would a verbose log right after that message suffice? One would have to turn down the log-level to verbose manually but it would give the same info.

The reason I'm asking is: A stack trace dumped to the console always gives the impression to users that there's an unhandled error somewhere and I'd like to avoid the flood of bug reports that get mis-categorized as "unhandled" errors when it's actually a properly handled error.

I've written down a proposal of how that would look like at #5113, please let me know what you think 🙂

@neilfordyce
Copy link
Contributor Author

Thanks for the feedback and raising the proposal 🏅

Happy for you to close this since all the details are captured better the proposal. I like the approach of having an additional log message at a lower priority log level. Makes a lot of sense. Would save us from a large $ logging bill too.

I'd possibly lean towards making the new log debug instead of verbose. In the specific case I'm thinking of, I will probably need to turn on this level of logging for a few containers in production to track it down. Reproducing in isolation locally might be tricky. But from DiagLogger docs, it sounds like turning on verbose would be ill-advised in prod.

A stack trace just referring to lines of code maybe fits debug. Verbose sounds like it's maybe even more verbose than that; possibly even containing any data the application is handling. Sounds like it's a bit of a grey area though and either would work, so happy with which ever you decide.

@pichlermarc pichlermarc added triage:accepted This feature has been accepted and removed triage labels Nov 6, 2024
@pichlermarc
Copy link
Member

@neilfordyce thanks for the response - let's do a debug log then 👍
I changed the description and requirements on #5113 - let's track the implementation progress there 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants