Skip to content

perf: add Benchmarks for Metrics

e08d695
Select commit
Loading
Failed to load commit list.
Draft

feat: add TagList overload to Metrics-Emit APIs as Attributes parameter #5241

perf: add Benchmarks for Metrics
e08d695
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed May 18, 2026 in 8m 45s

1 issue

find-bugs: Found 1 issue (1 low)

Low

TagList null values bypass null check via `!`, producing spurious null-not-supported warnings during serialization - `src/Sentry/SentryMetricEmitter.cs:62`

In SentryAttributes.SetAttributes(in TagList) (new in this PR), TagList exposes entries as KeyValuePair<string, object?> and explicitly permits null values. The new code uses new SentryAttribute(attribute.Value!), silently storing null values into the dictionary. At serialization time, SentryAttributeSerializer.WriteAttribute detects null and emits LogWarning("'null' is not supported by Sentry-Attributes and will be ignored."). This contradicts the documented behavior of nulls being silently ignored (see XML doc on TryGetAttribute: 'null → ignored'), and differs from the IEnumerable/ReadOnlySpan overloads whose KeyValuePair<string, object> element types statically preclude nulls. Recommend skipping null entries explicitly: if (attribute.Value is not null) this[attribute.Key] = new SentryAttribute(attribute.Value);.


⏱ 8m 13s · 2.2M in / 125.1k out · $4.15