10 releases

0.2.3 Oct 27, 2022
0.2.2 Sep 9, 2021
0.1.5 Jul 25, 2020
0.1.4 Feb 27, 2020
0.1.1 Jan 24, 2020

#176 in Debugging

Download history 48/week @ 2023-12-22 80/week @ 2023-12-29 55/week @ 2024-01-05 130/week @ 2024-01-12 158/week @ 2024-01-19 192/week @ 2024-01-26 390/week @ 2024-02-02 291/week @ 2024-02-09 495/week @ 2024-02-16 591/week @ 2024-02-23 409/week @ 2024-03-01 668/week @ 2024-03-08 317/week @ 2024-03-15 167/week @ 2024-03-22 166/week @ 2024-03-29 106/week @ 2024-04-05

940 downloads per month
Used in cosmos-utils

MIT license

4.5K SLoC

Application Insights for Rust

build-status crate-status docs-status dependabot-status

This project provides a Rust SDK for Application Insights. Application Insights is an APM service that helps to monitor running applications. This Rust crate allows to send various kinds of telemetry information to the server to be visualized later on Azure Portal.

🚩 Disclaimer
This project is not an officially recognized Microsoft product and is not an endorsement of any future product offering from Microsoft.

Microsoft and Azure are registered trademarks of Microsoft Corporation.


$ cargo add appinsights

or just add this to your Cargo.toml:

appinisghts = "0.2"


To start tracking telemetry for your application first thing you need to do is to obtain an Instrumentation Key and initialize TelemetryClient with it.

This client will be used to send all telemetry data to Application Insights. This SDK doesn't collect any telemetry automatically, so this client should be used everywhere in the code to report health information about an application.

use appinsights::TelemetryClient;

async fn main() {
    // configure telemetry client with default settings
    let client = TelemetryClient::new("<instrumentation key>".to_string());
    // send event telemetry to the Application Insights server
    client.track_event("application started");

    // stop the client

If you need more control over the client's behavior, you can create a new instance of TelemetryConfig and initialize a TelemetryClient with it.

use std::time::Duration;
use appinsights::{TelemetryClient, TelemetryConfig};
use appinsights::telemetry::SeverityLevel;

async fn main() {
    // configure telemetry config with custom settings
    let config = TelemetryConfig::builder()
        // provide an instrumentation key for a client
        .i_key("<instrumentation key>")
        // set a new maximum time to wait until data will be sent to the server
        // construct a new instance of telemetry configuration

    // configure telemetry client with default settings
    let client = TelemetryClient::from_config(config);

    // send trace telemetry to the Application Insights server
    client.track_trace("A database error occurred", SeverityLevel::Warning);

    // stop the client


This project is licensed under the terms of the MIT license.


~353K SLoC