easy-tracing

Crates.ioeasy-tracing
lib.rseasy-tracing
version0.2.0
created_at2025-11-20 16:11:28.677491+00
updated_at2025-12-07 16:18:57.141789+00
descriptionA crate to easy use tracing
homepage
repositoryhttps://github.com/NPCRay/easy-tracing.git
max_upload_size
id1942230
size81,195
Ray (NPCRay)

documentation

README

easy-tracing

This crate aims to provide simple and easy-to-use distributed tracing functionality for Rust programs.

Previously, implementing distributed tracing in Rust programs required introducing external tracing libraries such as opentelemetry and tracing-subscriber, then configuring them according to documentation, which was very cumbersome.

This crate provides a simple way to quickly implement distributed tracing in Rust programs.

Usage

easy_tracing::init(
    "app-name",
    "INFO",
    easy_tracing::LogFormat::Line,
    Some("127.0.0.1:4317"),
);

Where:

  • app-name is the application name
  • INFO is the log level
  • Line/Json is the log format
  • 127.0.0.1:4317 is the address of the OTLP gRPC tracing service

Logging

Logging is implemented using the tracing-subscriber library. After initialization, you can directly output logs through macros like tracing::info!() and tracing::error!(). Both Line and Json log formats are supported.

Tracing

Distributed tracing is implemented using the OpenTelemetry SDK. It only supports output via the OTLP gRPC protocol, and by default, trace information will be included in the logs.

Metrics

Manual metric instrumentation is not supported by default. It is recommended to use spanmetricsconnector to convert span data to metric data for observation rather than manual instrumentation.

Commit count: 0

cargo fmt