Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Span resource name set with tag is not used

Open
#2,374 2 comments 0 reactions 0 assignees View on GitHub

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
Tech stack
android, java, kotlin

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

bug
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.

https://github.com/DataDog/dd-sdk-android/blob/b1d6ebb82d26299faa41195747198850dcef090d/features/dd-sdk-android-trace/src/main/java/com/datadog/trace/core/DDSpanContext.java#L404

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/dd-sdk-android

All issues in DataDog/dd-sdk-android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.