| Crates.io | armature-opentelemetry |
| lib.rs | armature-opentelemetry |
| version | 0.1.1 |
| created_at | 2025-12-26 23:54:52.15511+00 |
| updated_at | 2025-12-29 01:22:01.011281+00 |
| description | OpenTelemetry integration for Armature observability |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006454 |
| size | 121,911 |
OpenTelemetry integration for the Armature framework.
[dependencies]
armature-opentelemetry = "0.1"
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();
}
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())
}
init_tracer_jaeger("my-service", "localhost:6831").await;
init_tracer_otlp("my-service", "http://localhost:4317").await;
MIT OR Apache-2.0