irontelemetry-rust/README.md

4.3 KiB

IronTelemetry

IronTelemetry SDK for Rust

Error monitoring and crash reporting for Rust applications

Crates.io Documentation License: MIT

WebsiteDocumentationRust GuideGit


IronTelemetry helps you capture exceptions, track user journeys, and get actionable insights to fix issues faster. Built for developers who want simple, powerful error monitoring without the complexity.

Features

  • Error Capture - Capture errors with full context and metadata
  • Journey Tracking - Understand what users did before an error occurred
  • Breadcrumbs - Add context with custom breadcrumbs
  • Thread-Safe - Safe for concurrent use with Arc and RwLock
  • Async Support - Optional async feature for tokio/async-std
  • Zero-Copy - Efficient memory usage with borrowed data where possible

Installation

Add to your Cargo.toml:

[dependencies]
irontelemetry = "0.1"

For async support:

[dependencies]
irontelemetry = { version = "0.1", features = ["async"] }

Quick Start

Initialize the SDK

use irontelemetry::Client;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new("https://pk_live_xxx@irontelemetry.com")?;

    // Your application code

    Ok(())
}

Capture Errors

if let Err(e) = do_something() {
    client.capture_error(&*e);
}

// Or capture with message
client.capture_exception("RuntimeError", "Something went wrong");

Track User Journeys

use irontelemetry::{Client, BreadcrumbCategory, create_journey_manager};

let journey_manager = create_journey_manager(&client);
let mut journey = journey_manager.start_journey("Checkout Flow");
journey.set_user("user-123", Some("user@example.com"), Some("John Doe"));

let result = journey.run_step("Validate Cart", BreadcrumbCategory::Business, || {
    validate_cart()
});

if let Err(e) = result {
    journey.fail(Some(&e.to_string()));
    client.capture_exception("ValidationError", &e.to_string());
    return Err(e.into());
}

journey.complete();

Add Breadcrumbs

use irontelemetry::BreadcrumbCategory;

client.add_breadcrumb("User clicked checkout button", BreadcrumbCategory::Ui);
client.add_breadcrumb("Payment API called", BreadcrumbCategory::Http);

Configuration

use irontelemetry::{Client, TelemetryOptions};

let options = TelemetryOptions::new("https://pk_live_xxx@irontelemetry.com")
    .environment("production")
    .app_version("1.2.3")
    .sample_rate(1.0)
    .debug(false);

let client = Client::with_options(options)?;

Documentation

For complete documentation, visit irontelemetry.com/docs.

Other SDKs

Platform Package
JavaScript/TypeScript @ironservices/telemetry
.NET IronTelemetry.Client
Python irontelemetry
Go irontelemetry-go
Java irontelemetry-java

Support

License

MIT License - see LICENSE for details.