[][src]Struct opentelemetry_application_insights::Exporter

pub struct Exporter { /* fields omitted */ }

Application Insights span exporter

Implementations

impl Exporter[src]

pub fn new(instrumentation_key: String) -> Self[src]

Create a new exporter.

pub fn with_application_version(self, ver: String) -> Self[src]

Add an application version to all telemetry items.

let exporter = opentelemetry_application_insights::Exporter::new("...".into())
    .with_application_version(std::env!("CARGO_PKG_VERSION").into());

pub fn with_sample_rate(self, sample_rate: f64) -> Self[src]

Set sample rate, which is passed through to Application Insights. It should be a value between 0 and 1 and match the rate given to the sampler.

Default: 1.0

let sample_rate = 0.3;
let exporter = opentelemetry_application_insights::Exporter::new("...".into())
    .with_sample_rate(sample_rate);
let provider = sdk::Provider::builder()
    .with_simple_exporter(exporter)
    .with_config(sdk::Config {
        default_sampler: Box::new(sdk::Sampler::Probability(sample_rate)),
        ..Default::default()
    })
    .build();

Trait Implementations

impl Debug for Exporter[src]

impl SpanExporter for Exporter[src]

fn export(&self, batch: Vec<Arc<SpanData>>) -> ExportResult[src]

Export spans to Application Insights

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,