sentry-opentelemetry 0.48.5

Sentry integration for OpenTelemetry.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use sentry::{ClientOptions, Hub};
use sentry_core::test::TestTransport;

use std::sync::Arc;

pub fn init_sentry(traces_sample_rate: f32) -> Arc<TestTransport> {
    let transport = TestTransport::new();
    let options = ClientOptions::new()
        .dsn("https://test@sentry-opentelemetry.com/test")
        .transport(transport.clone())
        .sample_rate(1.0)
        .traces_sample_rate(traces_sample_rate);
    Hub::current().bind_client(Some(Arc::new(options.into())));
    transport
}