Skip to content

0.48.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 28 Apr 15:45

Breaking Changes

New Features

📊📈💯 The Sentry-Rust SDK now supports emitting Sentry Metrics (#1073)!

To get started, you will need to add the metrics feature flag when compiling the sentry crate. You will also need to enable metrics when initializing the SDK, like so:

use sentry::ClientOptions;

let _guard = sentry::init((
    "(your DSN here)",
    ClientOptions {
        enable_metrics: true,
        // ... other options ...
        ..Default::default()
    },
));

You can then capture metrics as follows:

use sentry::metrics;
use sentry::types::protocol::latest::Unit;

// We support counter, gauge, and distribution metrics.
metrics::counter("example.counter", 1).capture();
metrics::gauge("connections", 20).capture();
metrics::distribution("response.time", 123.4)
    .unit(Unit::Millisecond) // units can also be set on gauges
    .attribute("http.status", 200) // attributes can be set on all metric types
    .capture();

Fixes

  • Fixed several feature additivity SemVer violations, where enabling a feature flag could have introduced breaking changes. All known violations are fixed now, so simply enabling an additional feature flag in any Sentry SDK crate should no longer cause any public API breakages. Fixing these issues required us to break the public API in some places; those breakages are detailed above.