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

Span resource name set with tag is not used #2374

Open
paco-spr opened this issue Nov 5, 2024 · 2 comments
Open

Span resource name set with tag is not used #2374

paco-spr opened this issue Nov 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@paco-spr
Copy link

paco-spr commented Nov 5, 2024

Describe the bug

Using a tag to set the resource name does not work and instead shows up as the operation name in the datadog ui. This comes from a bug in this library and even has a TODO comment to resolve it. In DDSpanContext getResourceName does not read the "resource.name" set in the tags, but it does read it when returning a value for hasResourceName. You can work around this by casting the span to DDSpan and setting the resource name using span.setResourceName() but this seems like a bug in the library.

Reproduction steps

import io.opentracing.util.GlobalTracer

val spanBuilder = GlobalTracer.get().build("operation_name")
spanBuilder.withTag("resource.name", "custom resource name")
spanBuilder.start().finish()

Logcat logs

No response

Expected behavior

No response

Affected SDK versions

2.14.0

Latest working SDK version

never

Did you confirm if the latest SDK version fixes the bug?

Yes

Kotlin / Java version

No response

Gradle / AGP version

No response

Other dependencies versions

No response

Device Information

No response

Other relevant information

No response

@paco-spr paco-spr added the bug Something isn't working label Nov 5, 2024
@mariusc83
Copy link
Collaborator

Hi @paco-spr , thank you for taking the time to repot this. This is indeed a bug in our library and indeed you could use the workaround (span as DDSpan).setResourceName to go around this problem. We are going to open a ticket on our end to fix this in the next SDK versions. On the other hand I am wondering if you've noticed our new release of OpenTelemetry support: https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/android/otel/?tab=kotlin. I recommend you on the long term to try to switch to this new API as this will be better maintained in the future and this bug is not there in this newer implementation.

@paco-spr
Copy link
Author

paco-spr commented Nov 5, 2024

Hi @paco-spr , thank you for taking the time to repot this. This is indeed a bug in our library and indeed you could use the workaround (span as DDSpan).setResourceName to go around this problem. We are going to open a ticket on our end to fix this in the next SDK versions. On the other hand I am wondering if you've noticed our new release of OpenTelemetry support: https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/android/otel/?tab=kotlin. I recommend you on the long term to try to switch to this new API as this will be better maintained in the future and this bug is not there in this newer implementation.

I had not seen that. Thanks for confirming the bug and suggesting the new API we will update on our end as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants