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

Marking agent auto instrumentation span as ok from code #13288

Open
anderssv opened this issue Feb 13, 2025 · 4 comments
Open

Marking agent auto instrumentation span as ok from code #13288

anderssv opened this issue Feb 13, 2025 · 4 comments
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@anderssv
Copy link

Is your feature request related to a problem? Please describe.

We are calling a Postgres DB and getting exceptions for the normal flow of things (we shouldn't, but do). In the current code we set the span status to ok when we catch the exception. But this is not reflected in the child span started by the agent auto instrumentation.

We would like these to be set as OK, but need to do this from the call site (the parent span). Could it be possible to add a context attribute to say something to the agent about expected results?

We're using Applicationinsights agent, which is a repackaged OT agent to my understanding.

Describe the solution you'd like

A way to update the child as ok. A less optimal way could be to instruct the agent to disable auto instrumentation for the following call.

Describe alternatives you've considered

I see there are options to disable a certain auto instrumentation and filter on classes etc, but this is actually more fine grained than that.

Additional context

No response

@anderssv anderssv added enhancement New feature or request needs triage New issue that requires triage labels Feb 13, 2025
@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Feb 18, 2025
@anderssv
Copy link
Author

That will probably work, but requires a lot of packaging (separate jar) and possibly project setup.

I am a big fan of being able to do things in code at the specific call site for these things. And I do believe this is a quite common issue when using the agent. It would probably benefit many of us to be able to do this in a simple way.

We will probably re-factor away from catching exceptions in our specific case, but I do see other cases where this could be useful too.

@github-actions github-actions bot removed the needs author feedback Waiting for additional feedback from the author label Feb 18, 2025
@trask
Copy link
Member

trask commented Mar 27, 2025

just adding the obligatory link to open-telemetry/oteps#207 (@anderssv yes this should be easier, someday it will be, but unfortunately not today)

@anderssv
Copy link
Author

This also is a relevant discussion: open-telemetry/opentelemetry-specification#4131

Note that this specific issue is mainly because of using auto-instrumentation from the agent, as that means I don't have access to the code sites that creates a child span of the one I have control over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

3 participants