Span resource name set with tag is not used
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- observability-sre
Research direction
Start in features/dd-sdk-android-trace/src/main/java/com/datadog/trace/core/DDSpanContext.java at getResourceName and compare it with hasResourceName. Reproduce the Kotlin span-builder example using resource.name, then verify that the resource name is shown as the resource rather than the operation name in Datadog UI.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Kotlin
- Stars
- 227
- Forks
- 86
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 74
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/dd-sdk-android
-
question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
DataDog/dd-sdk-android#3888 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 32/100
DataDog/dd-sdk-android#3223 · 4 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
automatically closed question stale
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataDog/dd-sdk-android#2970 · 6 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
DataDog/dd-sdk-android#2700 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataDog/dd-sdk-android#2132 · 1 comment ·
Maintainers usually reply within 1 day
All issues in DataDog/dd-sdk-android
Similar issues
-
Meta request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
keiyoushi/extensions-source#19500 ·
Maintainers usually reply within 1 day
-
go 🏃 testing 🧪
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
valkey-io/valkey-glide#7239 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ethereum-lists/chains#8788 ·
Maintainers usually reply within 1 day
-
documentation P1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/kotlin-sdk#1050 ·
Maintainers usually reply within 2 days