getsentry / getsentry/sentry-dotnet
The SetDefaultAttributes call in CaptureLog overwrites user-set attributes from the configureLog callback
- Dominant language
- C#
- Stars
- 770
- Forks
- 248
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 49
Description
> This is not a new problem, but existing behavior, that we now add more default attributes that potentially overwrite user-defined attributes. Previously, we would overwrite
>
> - `sentry.environment`
>
> - `sentry.release`
>
> - `sentry.sdk.name`
>
> - `sentry.sdk.version`
>
>
>
> We could open a follow-up to change this behavior.
>
>
>
> This is technically a change in behavior, so we might want to do this in the next major (`v7.0.0`).
>
> But we probably do want to do this, because with Metrics we did get it right where user-attributes might overwrite default-attributes.
>
>
_Originally posted by @Flash0ver in [#5216](https://github.com/getsentry/sentry-dotnet/pull/5216/changes#r3529633373)_
Contributor guide
Research direction
Start by locating CaptureLog and its SetDefaultAttributes call, then trace how the configureLog callback supplies user attributes. Confirm the ordering that causes defaults to overwrite those values and define completion as preserving user-set attributes while retaining defaults for unset fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100