This directory contains various examples showing off how to use different autometrics features and integrations.
You can run each of the examples with:
cargo run --package example-{name of example}
- actix-web - Use autometrics to instrument HTTP handlers using the
actix-web
framework - axum - Use autometrics to instrument HTTP handlers using the
axum
framework - custom-metrics - Define your own custom metrics alongside the ones generated by autometrics (using any of the metrics collection crates)
- exemplars-tracing - Use fields from
tracing::Span
s as Prometheus exemplars - opentelemetry-push - Push metrics to an OpenTelemetry Collector via the OTLP HTTP or gRPC protocol using the Autometrics provided interface
- grpc-http - Instrument Rust gRPC services with metrics using Tonic, warp, and Autometrics.
- opentelemetry-push-custom - Push metrics to an OpenTelemetry Collector via the OTLP gRPC protocol using custom options
Look at the full-api example to see autometrics in use in an example API server built with axum
, thiserror
, and tokio
.