38 breaking releases
0.39.0 | Feb 23, 2025 |
---|---|
0.37.0 | Nov 12, 2024 |
0.34.0 | Jul 20, 2024 |
0.30.0 | Mar 8, 2024 |
0.1.2 | Jul 25, 2020 |
#80 in Debugging
28,191 downloads per month
Used in 2 crates
(via axum-insights)
170KB
3K
SLoC
opentelemetry-application-insights
An Azure Application Insights exporter implementation for OpenTelemetry Rust.
Disclaimer: This is not an official Microsoft product.
Usage
Configure a OpenTelemetry pipeline using the Application Insights exporter and start creating spans (this example requires the opentelemetry-http/reqwest feature):
use opentelemetry::{global, trace::Tracer};
use opentelemetry_sdk::trace::SdkTracerProvider;
fn main() {
let connection_string = std::env::var("APPLICATIONINSIGHTS_CONNECTION_STRING").unwrap();
let exporter = opentelemetry_application_insights::Exporter::new_from_connection_string(
connection_string,
reqwest::blocking::Client::new(),
)
.expect("valid connection string");
let tracer_provider = SdkTracerProvider::builder()
.with_batch_exporter(exporter)
.build();
global::set_tracer_provider(tracer_provider.clone());
let tracer = global::tracer("example");
tracer.in_span("main", |_cx| {});
tracer_provider.shutdown().unwrap();
}
See documentation for more:
Application Insights integration
Thanks
Huge thanks goes to Denis Molokanov for the amazing appinsights crate. Check it out if you want a more direct integration with Application Insights.
Documentation
The only official documentation I could find is this one. Follow the links to see the data model and endpoint description.
Can I send telemetry to the Application Insights portal?
We recommend you use our SDKs and use the SDK API. There are variants of the SDK for various platforms. These SDKs handle buffering, compression, throttling, retries, and so on. However, the ingestion schema and endpoint protocol are public.
Dependencies
~5–38MB
~604K SLoC