Skip to content

Metrics improvements - #3191

Merged
jamescrosswell merged 9 commits into
mainfrom
metric-improvements
Mar 6, 2024
Merged

jamescrosswell merged 9 commits into
mainfrom
metric-improvements

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Mar 4, 2024

Copy link
Copy Markdown
Collaborator

Resolves #3175

Span Aggregates

Emitted metrics are now displayed for spans (e.g. here):

image

Automatic Tags

Tags are set on metrics for Release, Environment and Transaction (where these are present):

image

@jamescrosswell
jamescrosswell marked this pull request as ready for review March 5, 2024 08:47
Comment thread src/Sentry/Internal/Extensions/ReadOnlyDictionaryExtensions.cs Outdated
Comment thread src/Sentry/MetricAggregator.cs Outdated
Comment thread src/Sentry/SentrySpan.cs
Comment thread src/Sentry/Protocol/Metrics/LocalAggregate.cs Outdated
Comment thread src/Sentry/SpanTracer.cs Outdated
Comment thread src/Sentry/LocalAggregator.cs Outdated
{
writer.WritePropertyName(exportKey);
writer.WriteStartArray();
foreach (var metric in value.OrderBy(x => MetricHelper.GetMetricBucketKey(x.MetricType, x.Key, x.Unit, x.Tags)))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw: I'd love to get rid of the OrderBy here. This only exists to ensure the order of things in JSON stays exactly the same, so our Verify tests pass. If I could work out how to have Verify do a Deep object comparison rather than a string compare, we could get rid of the OrderBy here and the ToImmutableSortedDictionary call above.

@bitsandfoxes bitsandfoxes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: LGTM!
The IMetricsHub still makes me feel itchy.

@jamescrosswell
jamescrosswell merged commit 448b2e2 into main Mar 6, 2024
@jamescrosswell
jamescrosswell deleted the metric-improvements branch March 6, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metrics Improvement

3 participants