router icon indicating copy to clipboard operation
router copied to clipboard

Setting RUST_LOG=error does not displays some metrics

Open manaljain6667 opened this issue 1 year ago • 3 comments

Describe the bug Setting RUST_LOG=error does not displays some metrics

To Reproduce Steps to reproduce the behavior:

Run following command from router/examples/telemetry to reproduce the behavior:

RUST_LOG=error cargo run -- -s ../graphql/supergraph.graphql -c otlp.router.yaml

when setting RUST_LOG=error Screenshot 2024-04-10 at 2 46 09 PM

when setting RUST_LOG=info Screenshot 2024-04-10 at 2 45 01 PM

manaljain6667 avatar Apr 16 '24 16:04 manaljain6667

This is most likely due to the Metric's layer which uses tracing events for metrics. If the EnvFilter does not enable the event the metrics layer won't see it.

xuorig avatar Apr 17 '24 12:04 xuorig

Hi @xuorig , in our case we want to see all the metrics exposed in the prometheus route irrespective of the log level set. Is there a way to achieve this? Because logs can get pretty chatty, and we'd still want to be able to monitor the health and these metrics for router.

harshitkumar31 avatar Apr 18 '24 04:04 harshitkumar31

We now have new macros to generate metrics and it won't be affected by the log level anymore. We have to migrate all our current metrics to that new mechanism

bnjjj avatar Apr 18 '24 17:04 bnjjj