This API change will ensure that any metrics that you collect are connected to a span. With this connection ensured, all metrics will always be contextually linked to the rest of your Sentry data through traces.
We will communicate the API change before it happens, but wanted to inform you now of this planned change as eventually you will need to migrate to the new APIs.
Why are we making this change?
Today the custom metrics you send to Sentry are collected independently of spans. They are automatically coupled to a span if one is active, but we neither enforce this behavior, nor provide an API to control it. We found via the beta process that this lack of structure in our API greatly reduces the value of metrics in real-world debugging and observability workflows.
Our goal is also to simplify the product and purchasing experience by fully integrating Metrics with Tracing, allowing us to avoid separate charges for metrics and ensuring you can measure and debug seamlessly.
What happens to the metrics I’m currently sending?
There are no immediate changes to the metrics you have already instrumented. They will continue to be collected in Sentry as-is until the new APIs are released.
How can I continue using Metrics once the new APIs are released?
To continue using Metrics after the release, you will need to update your SDK and migrate your implementation to the new APIs.
Although the current APIs will be deprecated once the new ones are released, they will still be supported for a sufficient period to allow for a smooth transition. Once the old APIs will be removed, metrics using them will no longer be ingested.
What is changing in the product?
There are no immediate changes to the product capabilities. You can continue using the Metrics page, as well as creating Dashboard widgets and Alerts with custom metrics as-is. We aim to keep all the same product functionality also after the release of the new API.
In the future, the metric ↔ span connection will enable more effective debugging workflows, allowing you to search across all your Sentry data that is fully connected through tracing.
I am sampling traces on the client, what does this mean for metrics?
Today metrics are independent of spans, so sampling on spans has no effect on metrics. With the upcoming changes, since we are enforcing automatic connection between metrics and spans, the tracesSampleRate you set will also affect metrics.
Our new solution will however be sampling-aware, which enables us to use the sample rates to extrapolate and reconstruct a fairly accurate representation of your data. More details will be available once the new APIs are released.
If metrics are connected to spans, will they use my Tracing quota?
During the beta period, Metrics will continue to be free of charge even after the changes connecting them to spans have been released and will not consume your Tracing quota. Once Metrics become generally available, we currently plan to charge for the connected spans instead of a standalone charge for metrics. At that time, using Metrics will consume your Tracing quota.
How can I get notified once the new APIs are released?
Once the new APIs are released, we will notify you in-product and update our documentation. We will also post updates to Discord and GitHub.
Have another question?
If you have other questions about this change and how it impacts your organization, please reach out on Discord or GitHub.