Skip to content

feat(core): Decouple metrics aggregation from client #10628

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

Merged
merged 9 commits into from
Feb 16, 2024

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Feb 13, 2024

This is a re-opening of #10596 which was closed automatically after the branch is was based off was closed.

Part of the work for #10595

This PR decouples metrics aggregation from the client and stores the aggregator globally the first time it is required.

This PR does not remove captureAggregateMetrics from the BaseClient or make sendEnvelope public as this can occur in a later PR. This will remove the remaining metrics code from the most basic tree-shaken Sentry configuration.

The default (node) metrics implementation remains in @sentry/core because it's required for Deno and Vercel-Edge which don't ref. @sentry/node.

There's a load of extra deletions and cleanup that can occur for v8 when the integration is deleted. For example BrowserMetricsAggregator can probably move to @sentry/browser.

@timfish timfish requested a review from AbhiPrasad February 13, 2024 01:46
@timfish
Copy link
Collaborator Author

timfish commented Feb 13, 2024

Rather than deprecate things that would be semver breaking changes for v8, I've just deleted them since we're now on the v8 path....

This means I've removed:

  • BaseClient.metricsAggregator
  • Sentry.metrics.MetricsAggregator
  • Sentry.metrics.metricsAggregatorIntegration

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Would be nice to get some more integration tests for metrics in general so we can validate that this doesn't break anything.

Also now that develop is the v8 branch, feel free to make any breaking changes you think are needed to improve the API here.

Woops didn't read your comment. Can we add a migration doc please!

@timfish
Copy link
Collaborator Author

timfish commented Feb 16, 2024

I've now added to MIGRATION.md and added a browser integration test for metrics!

@AbhiPrasad AbhiPrasad merged commit a8966d1 into getsentry:develop Feb 16, 2024
@timfish timfish deleted the feat/decouple-metrics branch February 17, 2024 15:11
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.

2 participants