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.9", = ["attributes"] }
= { = "0.14", = ["async-std", "rt-async-std"] }
= { = "0.13", = ["async-std"] }
= "0.9"
= "0.16"
server.rs
use ;
use resource;
use TideExt;
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.