OpenTelemetry integration for Tide
Add OpenTelemetry tracing and metrics support to your tide application. Be part of the new observability movement!
Notes
- It only implements very basic request tracing on the middleware layer. If you need spans for your executed code, you need to add them yourself.
- It provides basic prometheus metrics, based on the RED method.
- This project got inspired by https://github.com/OutThereLabs/actix-web-opentelemetry.
- You probably do not want to use it in production. 🤷
How to use
# Run jaeger in background
# Run server example with tracing middleware
# Make a request or two ...
# Open browser and view the traces
# Check the prometheus metrics endpoint
Example
Cargo.toml
# ...
[]
= { = "1.10", = ["attributes"] }
= { = "0.17.0", = ["rt-async-std"] }
= { = "0.16.0", = ["rt-async-std"] }
= "0.12"
= "0.16"
server.rs
use ;
use resource;
use TideExt; // import trait
const VERSION: &'static str = env!;
async
Cargo Features
flag | description |
---|---|
trace |
enables tracing middleware; enabled by default via full |
metrics |
enables metrics middleware; enabled by default via full |
full |
includes both trace and metrics features, enabled by default |
Safety
This crate uses #![forbid(unsafe_code)]
to ensure everything is implemented in 100% Safe Rust.