Add device and OS attributes to metrics on mobile, as the native SDKs do
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend-api-design, observability
Research direction
Read the metrics spec linked in the issue and compare its default attribute guidance with the native SDK behavior described for sentry-java and sentry-cocoa. If the SDK and ingest teams decide .NET should match the native SDKs, inspect SentryOptions.DeviceLogAttributes and SentryMetric.Factory.cs, where SetDefaultAttributes is called. Done means the decision is reflected consistently in the metrics attributes and, if needed, the spec.
Written by the indexing model from the issue text.
Description
Problem Statement
#6028 adds device and OS attributes (os.name, os.version, device.brand, device.model, device.family) to structured logs on Android, iOS and Mac Catalyst, as the logs spec asks of mobile SDKs. Metrics don't get them.
The native SDKs we wrap do add them to metrics:
- sentry-java (8.66.0):
DefaultAndroidEventProcessor.process(SentryMetricsEvent, Hint)sets the same five attributes it sets on logs. - sentry-cocoa (9.35.0):
TelemetryScopeApplieradds the OS and device attributes to every telemetry item, metrics included.
So a metric emitted from .NET on Android or iOS carries fewer attributes than one emitted from the native SDK in the same app.
Why this needs a decision first
The metrics spec doesn't list device or OS attributes. It also says SDKs SHOULD minimize default attributes because of cardinality, and that new defaults SHOULD only be added after discussion with the SDK and ingest teams. The native SDKs go beyond that.
The question is whether .NET should match the native SDKs or follow the spec as written, and whether the spec should be updated.
Solution Brainstorm
If we match the native SDKs, the work is small. #6028 adds an internal SentryOptions.DeviceLogAttributes hook, filled by the Android and Cocoa integrations and applied in SentryLog.SetDefaultAttributes. Metrics would apply the same hook in SentryMetric.Factory.cs, where SetDefaultAttributes is already called. The hook would then want a name that isn't specific to logs.
- Dominant language
- C#
- Stars
- 775
- Forks
- 262
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 118
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 getsentry/sentry-dotnet
-
chore: remove stale IL3050/IL3053 workaround from the iOS samplePossibly taken A pull request linked to this issue is open or already merged. OpenState: Needs Discussion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-dotnet#6071 · 1 comment ·
Maintainers usually reply within 1 day
-
Heap dumps: every SDK shutdown logs "Error waiting for GarbageCollectionMonitor task to complete"Possibly taken @pcbeingused33 claimed this today. OpenState: Needs Discussion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-dotnet#6039 · 3 comments ·
Maintainers usually reply within 1 day
-
.NET Platform: Android Task
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dotnet#6020 · 3 comments ·
Maintainers usually reply within 1 day
-
Move the Blazor WebAssembly sample off the deprecated DevServerPossibly taken A pull request linked to this issue is open or already merged. Open.NET Framework: Blazor
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
getsentry/sentry-dotnet#5906 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Docs MSBuild Needs Docs Update
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-dotnet#5691 · 1 comment ·
Maintainers usually reply within 1 day
All issues in getsentry/sentry-dotnet
Similar issues
-
In-car displays show 0 km/h and P while the AV drivesPossibly taken @bazilinskyy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bazilinskyy/coupled-sim#366 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BaryoDev/umbraco-pwa#196 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/fluentui-blazor#5688 ·
Maintainers usually reply within 1 day
-
bug flaky lsp-transport small
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day