solana-labs/solana

Decouple metrics submission from RUST_LOG

Open

#15.215 aperta il 9 feb 2021

Vedi su GitHub
 (14 commenti) (6 reazioni) (1 assegnatario)Rust (3950 fork)batch import
good first issue

Metriche repository

Star
 (12.651 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Problem

It is occasionally desired to reduce text log size, but continue submitting full metrics. With metrics level taken from RUST_LOG, this is not possible.

Relevant Code

Datapoints are pushed to the MetricsAgent based on log level here: https://github.com/solana-labs/solana/blob/d4ce59eee7e2537f02c827b6918de9af559b06bd/metrics/src/datapoint.rs#L153-L165

If the datapoint has sufficient log-level based on RUST_LOG to get submitted, then it will eventually reach here where it is both logged to file and pushed into a vector to be sumitted. https://github.com/solana-labs/solana/blob/d4ce59eee7e2537f02c827b6918de9af559b06bd/metrics/src/metrics.rs#L261-L264

Proposed Solution

Look into the feasibility of decoupling metrics from RUST_LOG

Guida contributor