-
Notifications
You must be signed in to change notification settings - Fork 776
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
Allow overwriting/modyfing span resource in SpanProcessor #5395
Comments
In general, the Resource is not something that is supposed to be mutable like this, especially not in the middle of processing a span. If we were to add a feature like this, we'd need to have a specification update to account for it. I recommend suggesting it in the specification repository as an enhancement, as we wouldn't want to make a change this significant just for the Java implementation. |
Yup. Although the span processor suggests general processing capabilities, the types of modifications that are possible via
Neither option is super appealing, but may be preferable to hacking it with reflection. |
I've created the spec change request, what is the convention here? do you close this until the spec change is decided? Also, thanks for the alternative ideas! I'll think about them :) |
We'll leave it open with the |
Recommend linking to that spec issue here, so that it can more easily be followed up on. |
|
Is your feature request related to a problem? Please describe.
I'm using OTEL with DataDog (DD), and it would greatly help visibility if I could overwrite the service name for some operations (spans).
DD doesn't properly understand the semantics of OTEL, and the problem is extra visible when some services are instrumented using OTEL, and some are instrumented using the native DD agent. DD creates a separate "service" for database calls, HTTP calls, etc - basically, everything that "leaves" the service and that's super useful, because then the time spent in DB or HTTP calls really pops out and becomes super visible.
Describe the solution you'd like
Basically I'd like to be able to modify the resource of a span. Right now the resource field is final and
ReadWriteSpan
cannot modify it.Describe alternatives you've considered
Currently, I'm experimenting with hacking it using reflection, but I would like to avoid having to use that in the PROD... but as a prototype, it works really well...
OverrideServiceNameSpanProcessor
Additional context
You have to zoom in a little, but then you can see that the e.g.
redis
,pdo
,mongo
, etc. are shown as separate services - these spans are obviously part of the app that is calling them, but the native DD agent renames the single span's service name.It makes a lot of sense if you think about it for a bit - my database is obviously not instrumented with OTEL (maybe in the future?), so I don't have any spans from it - but I have the spans in my app that are calling the database and that is as close as I'll get in the near future to having the database calls rendered as a separate service.
The example image is not mine it's from some article - but it illustrates it nicely.
The text was updated successfully, but these errors were encountered: