opinionated_telemetry

Crates.ioopinionated_telemetry
lib.rsopinionated_telemetry
version0.2.0
sourcesrc
created_at2023-09-08 18:00:27.61467
updated_at2023-09-11 12:08:09.919184
descriptionOpinionated configuration for tracing and metrics crates (with OpenTelemetry & Prometheus).
homepagehttps://github.com/dbcrossbar/dbcrossbar/tree/main/crates/opinionated_telemetry
repositoryhttps://github.com/dbcrossbar/dbcrossbar
max_upload_size
id967675
size117,637
Eric Kidd (emk)

documentation

https://docs.rs/opinionated_telemetry/

README

opinionated_telemetry: Easy-to-use backend for metrics and tracing

This is a single crate that provides a simple, opinionated backend for metrics and tracing. The goal is to easily enable an existing Rust app to emit metrics and traces, without having to spend a lot of effort on configuration.

Documentation

This crate's opinions

All opionated software should try to list what opinions it holds, so users know whether it's a good fit for them. Here are the opinions of this crate:

  • Tracing and metrics are incredibly useful, and should be ubiquitous.
    • This includes CLI tools, not just servers!
  • Prometheus and Grafana are a solid combination for metrics and dashboards.
  • OpenTelemetry and W3C Trace Context are a popular choice for tracing.
    • But tracing backends are less standardized than Prometheus.
  • Rust's tracing and metrics façades are good enough to handle the basics, and reasonably standard.
  • "Labels" on metrics should be carefully chosen and "low-arity" (having few possible values). Therefore, inheriting labels from parent scopes is almost always the wrong thing to do.

Supported backends

Tracing:

Metrics:

  • Prometheus (scraping)
  • Prometheus (push gateway)
  • Debug (logged via tracing)
Commit count: 655

cargo fmt