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

Remove tracing::instrument from apply_debug_overrides #958

Merged
merged 2 commits into from Jul 19, 2022

Conversation

kazk
Copy link
Member

@kazk kazk commented Jul 19, 2022

Motivation

When logs are configured with span events, for example:

tracing_subscriber::fmt()
    .with_max_level(Level::INFO)
    .with_span_events(FmtSpan::CLOSE)
    .finish();

A warning is always logged in Config::infer() because apply_debug_overrides is always called, and has #[tracing::instrument(level = "warn")].

Solution

Remove #[tracing::instrument(level = "warn")] because I'm not sure how this span is useful.

Alternate Solution

Only call apply_debug_overrides when overrides are defined.

Or add skip(self) (#[tracing::instrument(level = "warn", skip(self))]) to minimize output.

A warning is shown even if no overrides are set.

Signed-off-by: kazk <kazk.dev@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2022

Codecov Report

Merging #958 (285a310) into master (1c34bf6) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #958      +/-   ##
==========================================
- Coverage   72.46%   72.43%   -0.03%     
==========================================
  Files          64       64              
  Lines        4412     4412              
==========================================
- Hits         3197     3196       -1     
- Misses       1215     1216       +1     
Impacted Files Coverage Δ
kube-client/src/config/mod.rs 50.00% <ø> (ø)
kube-runtime/src/wait.rs 69.81% <0.00%> (-1.89%) ⬇️

@clux
Copy link
Member

clux commented Jul 19, 2022

The deny error has a fix in the resource scope pr, feel free to cherry pick that in.

@clux clux added the changelog-fix changelog fix category for prs label Jul 19, 2022
@clux clux added this to the 0.75.0 milestone Jul 19, 2022
@kazk kazk merged commit fa66405 into kube-rs:master Jul 19, 2022
@kazk kazk deleted the remove-instrument-apply-debug-overrides branch July 19, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants