Tracing: How to add dynamic attributes to all spans?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- mobile-dev, observability-sre
Research direction
Start by reading the SpanEventMapper behavior and the definitions of SpanEvent and SpanEvent.Meta, especially additionalProperties, then compare them with OtelTracerProvider.Builder.addTag. The issue is done when the supported approach for dynamic attributes is established or an agreed API change is specified and covered by relevant tests.
Written by the indexing model from the issue text.
Description
Question
I'd like to be able to add an attribute that may change throughout the lifetime of the app to all spans logged by the SDK. I'm using OpenTelemetry so I can add tags that are static and known at initialization time via OtelTracerProvider.Builder.addTag, but this doesn't work for attributes that either aren't static or aren't known at initialization time.
I looked into SpanEventMapper but very little of the SpanEvent object is mutable (only resource and name) and the SDK drops Spans if the mapper returns a new object instead of the one that was passed in.
Is there another approach to solving this problem? If not, would you consider making SpanEvent.Meta.additionalProperties a MutableMap or exposing a setter to add properties?
- Dominant language
- Kotlin
- Stars
- 226
- Forks
- 86
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 65
Getting set up
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
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DataDog/dd-sdk-android#3904 · 1 comment ·
Maintainers usually reply within 1 day
-
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
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
DataDog/dd-sdk-android#2700 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
DataDog/dd-sdk-android#2374 · 2 comments ·
Maintainers usually reply within 1 day
All issues in DataDog/dd-sdk-android
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
recloudstream/cloudstream#3226 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aws/aws-crt-kotlin#309 ·
Maintainers usually reply within 3 days
-
OAI-PMH
Difficulty 2/5 1-3 hours Newbie friendliness 78/100