solana-labs/solana

Decouple metrics submission from RUST_LOG

開放

#15,215 建立於 2021年2月9日

 (14 則留言) (6 個反應) (1 位負責人)Rust (3,950 個分叉)batch import
good first issue

倉庫指標

星標
 (12,651 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南