pub struct Exporter<C> { /* private fields */ }
Expand description
Application Insights span exporter
Implementations§
Source§impl<C> Exporter<C>
impl<C> Exporter<C>
Sourcepub fn new(instrumentation_key: String, client: C) -> Self
👎Deprecated since 0.27.0: use new_from_connection_string() instead
pub fn new(instrumentation_key: String, client: C) -> Self
Create a new exporter.
Sourcepub fn new_from_env(
client: C,
) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
pub fn new_from_env( client: C, ) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
Create a new exporter.
Reads connection string from APPLICATIONINSIGHTS_CONNECTION_STRING
environment variable.
Sourcepub fn new_from_connection_string(
connection_string: impl AsRef<str>,
client: C,
) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
pub fn new_from_connection_string( connection_string: impl AsRef<str>, client: C, ) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
Create a new exporter.
Sourcepub fn with_retry_notify<N>(self, retry_notify: N) -> Self
pub fn with_retry_notify<N>(self, retry_notify: N) -> Self
Set a retry notification function that is called when a request to upload telemetry to Application Insights failed and will be retried.
Sourcepub fn with_endpoint(
self,
endpoint: &str,
) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
👎Deprecated since 0.27.0: use new_from_connection_string() instead
pub fn with_endpoint( self, endpoint: &str, ) -> Result<Self, Box<dyn StdError + Send + Sync + 'static>>
Set endpoint used to ingest telemetry. This should consist of scheme and authrity. The
exporter will call /v2/track
on the specified endpoint.
Default: https://dc.services.visualstudio.com
Sourcepub fn with_sample_rate(self, sample_rate: f64) -> Self
Available on crate feature trace
only.
pub fn with_sample_rate(self, sample_rate: f64) -> Self
trace
only.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
Sourcepub fn with_resource_attributes_in_events_and_logs(
self,
resource_attributes_in_events_and_logs: bool,
) -> Self
Available on crate features trace
or logs
only.
pub fn with_resource_attributes_in_events_and_logs( self, resource_attributes_in_events_and_logs: bool, ) -> Self
trace
or logs
only.Set whether resource attributes should be included in events.
This affects both trace events and logs.
Default: false.
Trait Implementations§
Source§impl<C> LogExporter for Exporter<C>where
C: HttpClient + 'static,
Available on crate feature logs
only.
impl<C> LogExporter for Exporter<C>where
C: HttpClient + 'static,
logs
only.Source§fn export(
&self,
batch: LogBatch<'_>,
) -> impl Future<Output = OTelSdkResult> + Send
fn export( &self, batch: LogBatch<'_>, ) -> impl Future<Output = OTelSdkResult> + Send
Source§fn set_resource(&mut self, resource: &Resource)
fn set_resource(&mut self, resource: &Resource)
Source§fn shutdown_with_timeout(&self, _timeout: Duration) -> Result<(), OTelSdkError>
fn shutdown_with_timeout(&self, _timeout: Duration) -> Result<(), OTelSdkError>
Source§impl<C> PushMetricExporter for Exporter<C>where
C: HttpClient + 'static,
Available on crate feature metrics
only.
impl<C> PushMetricExporter for Exporter<C>where
C: HttpClient + 'static,
metrics
only.Source§fn export(
&self,
metrics: &ResourceMetrics,
) -> impl Future<Output = OTelSdkResult> + Send
fn export( &self, metrics: &ResourceMetrics, ) -> impl Future<Output = OTelSdkResult> + Send
Source§fn force_flush(&self) -> OTelSdkResult
fn force_flush(&self) -> OTelSdkResult
Source§fn shutdown_with_timeout(&self, _timeout: Duration) -> OTelSdkResult
fn shutdown_with_timeout(&self, _timeout: Duration) -> OTelSdkResult
Source§fn temporality(&self) -> Temporality
fn temporality(&self) -> Temporality
Source§impl<C> SpanExporter for Exporter<C>where
C: HttpClient + 'static,
Available on crate feature trace
only.
impl<C> SpanExporter for Exporter<C>where
C: HttpClient + 'static,
trace
only.Source§async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
async fn export(&self, batch: Vec<SpanData>) -> OTelSdkResult
Export spans to Application Insights