armature-opentelemetry

Crates.ioarmature-opentelemetry
lib.rsarmature-opentelemetry
version0.1.1
created_at2025-12-26 23:54:52.15511+00
updated_at2025-12-29 01:22:01.011281+00
descriptionOpenTelemetry integration for Armature observability
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006454
size121,911
Joseph R. Quinn (quinnjr)

documentation

README

armature-opentelemetry

OpenTelemetry integration for the Armature framework.

Features

  • Distributed Tracing - Trace requests across services
  • Auto Instrumentation - HTTP, database, cache spans
  • Multiple Exporters - Jaeger, Zipkin, OTLP
  • Context Propagation - W3C Trace Context, B3
  • Baggage - Pass context across services

Installation

[dependencies]
armature-opentelemetry = "0.1"

Quick Start

use armature_opentelemetry::{init_tracer, TracingMiddleware};

#[tokio::main]
async fn main() {
    // Initialize tracer
    init_tracer("my-service", "http://localhost:4317").await;

    let app = Application::new()
        .with_middleware(TracingMiddleware::new())
        .get("/", handler);

    app.listen("0.0.0.0:3000").await.unwrap();
}

Custom Spans

use armature_opentelemetry::tracer;

async fn my_handler(req: HttpRequest) -> Result<HttpResponse, Error> {
    let span = tracer().start("process_request");

    // Do work...

    span.end();
    Ok(HttpResponse::ok())
}

Exporters

Jaeger

init_tracer_jaeger("my-service", "localhost:6831").await;

OTLP (OpenTelemetry Protocol)

init_tracer_otlp("my-service", "http://localhost:4317").await;

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt