Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics improvements #3191

Merged
merged 9 commits into from
Mar 6, 2024
Merged

Metrics improvements #3191

merged 9 commits into from
Mar 6, 2024

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Mar 4, 2024

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
src/Sentry/MetricAggregator.cs Outdated Show resolved Hide resolved
src/Sentry/SentrySpan.cs Outdated Show resolved Hide resolved
src/Sentry/Protocol/Metrics/LocalAggregate.cs Outdated Show resolved Hide resolved
src/Sentry/SpanTracer.cs Outdated Show resolved Hide resolved
src/Sentry/LocalAggregator.cs Outdated Show resolved Hide resolved
{
writer.WritePropertyName(exportKey);
writer.WriteStartArray();
foreach (var metric in value.OrderBy(x => MetricHelper.GetMetricBucketKey(x.MetricType, x.Key, x.Unit, x.Tags)))
Copy link
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.

Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

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
30 checks passed
@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