Skip to content

Lack of Beginner-Friendly Documentation for metrics_tracing_context #575

Open
@artsiomkaltovich

Description

@artsiomkaltovich

Hello,

First of all, thank you for your work on this project. I really appreciate it!

However, as a beginner, I’ve found it a bit difficult to understand how to use the metrics_tracing_context package.

The documentation starts with the following example:

use metrics_tracing_context::{MetricsLayer, TracingContextLayer};
use metrics_util::layers::Layer;
use tracing_subscriber::layer::SubscriberExt;

// Prepare tracing.
let subscriber = my_subscriber.with(MetricsLayer::new());
tracing::subscriber::set_global_default(subscriber).unwrap();

// Prepare metrics.
let recorder = TracingContextLayer::all().layer(my_recorder);
metrics::set_global_recorder(recorder).unwrap();

But I'm not quite sure what this is doing, or what my_subscriber refers to. Could it be addressed in the doc?

Also, is it possible to control which tracing fields are included as labels—either when registering metrics (e.g., with the register_gauge_vec macro) or when using methods like observe or inc?

I believe the documentation of this project could benefit from some improvements.

Thank you in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-exporterComponent: exporters such as Prometheus, TCP, etc.T-requestType: request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions