Skip to content

Add error priorities for dynamic instrumentation and manual instrumentation #9098

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deejgregor
Copy link

@deejgregor deejgregor commented Jul 3, 2025

What Does This Do

Adds error priorities for dynamic instrumentation and manual instrumentation, similar to what exists for priorities for resource name today.

It also sets the priority for manual instrumentation from otel spans for both resource name and error.

Motivation

Reliably override error status set by automatic instrumentation from dynamic instrumentation and manual instrumentation.

Additional Notes

No tests have been added yet. If the change generally seems good, I'm happy to write tests.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@deejgregor deejgregor requested review from a team as code owners July 3, 2025 21:12
@deejgregor deejgregor requested a review from amarziali July 3, 2025 21:12
@amarziali
Copy link
Contributor

amarziali commented Jul 8, 2025

👋 @deejgregor Thanks for having opened this pull request. Having one more level for manual instrumentation makes sense. I think there is no need to create an additional one for the TagInterceptor, since the setError here uses the default (That will be lower of the one created for manual instrumentation).
Also, if you can, would it be possible to add a test for this feature?
Thanks again for the contribution
Andrea

@amarziali amarziali added type: enhancement Enhancements and improvements comp: core Tracer core labels Jul 8, 2025
@@ -217,7 +217,7 @@ private boolean interceptDbStatement(DDSpanContext span, Object value) {
}

private boolean interceptError(DDSpanContext span, Object value) {
span.setErrorFlag(asBoolean(value), ErrorPriorities.DEFAULT);
span.setErrorFlag(asBoolean(value), ErrorPriorities.TAG_INTERCEPTOR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still use the default here. The ones using the interceptor, are setting a tag to infer the error flag.Both are falling hence into the manual instrumentation use case

@PerfectSlayer PerfectSlayer added the tag: community Community contribution label Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: core Tracer core tag: community Community contribution type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants