Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add metrics filter #1993

Merged
merged 1 commit into from
Apr 2, 2020

Conversation

keroro520
Copy link
Contributor

Filter metrics via log_enabled! inside metric!.

Enable metrics collection via configuring log filter. Here are some examples:

  • filter=info,ckb-metrics=trace: enable all metrics collection
  • filter=info,ckb-metrics=trace,ckb-metrics-sync=off: enable all metrics collection except topic "sync"
  • filter=info,ckb-metrics-sync=trace: only enable metrics collection of topic "sync"

Filter metrics via `log_enabled!` inside `metric!`.
let topic = $crate::__metric_topic!( $($args)* );
let filter = ::std::format!("ckb-metrics-{}", topic);
if $crate::log_enabled_target!(&filter, $crate::Level::Trace) {
let mut metric = $crate::json!( { $( $args )* });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@doitian
Copy link
Member

doitian commented Apr 2, 2020

bors r=doitian,zhangsoledad

@nervos-bot nervos-bot bot added the s:ready-to-merge Status: Waiting to be merged. label Apr 2, 2020
@bors
Copy link
Contributor

bors bot commented Apr 2, 2020

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 0911bdc into nervosnetwork:develop Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:ready-to-merge Status: Waiting to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants