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

Allow overwriting/modyfing span service name #3433

Open
fprochazka opened this issue Apr 24, 2023 · 3 comments
Open

Allow overwriting/modyfing span service name #3433

fprochazka opened this issue Apr 24, 2023 · 3 comments
Assignees
Labels
spec:trace Related to the specification/trace directory

Comments

@fprochazka
Copy link

What are you trying to achieve?

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.

Given that the service name is in resource and the resource is immutable, it would make sense to me to allow overwriting the whole resource of a span in custom span processors.

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.

image

The example image is not mine it's from some article - but it illustrates it nicely.

I was sent here from open-telemetry/opentelemetry-java#5395

@fprochazka fprochazka added the spec:trace Related to the specification/trace directory label Apr 24, 2023
@joaopgrassi
Copy link
Member

I wonder if this is isn't something a back-end could do (creating a redis service) by simply analyzing the attributes of a span? After all, that is probably one of the benefits of relying on semantic conventions.

@fprochazka
Copy link
Author

fprochazka commented Apr 24, 2023

Yeah, I don't see why it couldn't do that 👍

But the reality is that it's not doing that and allowing to customize this enables me to solve the problem right now, without having to wait for the mercy of a vendor, which might never fix it.

@Oberon00
Copy link
Member

I think the problem here is that what OTel calls "service" is a different concept from what DataDog calls "service". That said, did you check if you can maybe overwrite the resource attribute with a span attribute of the same name? You might then be able to use the SpanProcessor OnStart callback to do that.

Also check #1089, it may contain some related tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:trace Related to the specification/trace directory
Projects
None yet
Development

No branches or pull requests

4 participants