Skip to content

Conversation

@lalitb
Copy link
Member

@lalitb lalitb commented Nov 6, 2024

Changes

Add name attribute in logging macros till tracing::fmt starts supporting name metadata.
See issue: tokio-rs/tracing#2774

This will cause the name attribute duplicated for all other consumers, but should be fine for now.

o/p before change:

2024-11-06T21:29:27.830573Z  INFO main self_diagnostics: Starting self-diagnostics example
2024-11-06T21:29:27.831787Z ERROR main opentelemetry_sdk:  meter_name="example" instrument_name="my_counter with_space" Measurements from this Counter will be ignored. reason="Invalid instrument configuration: characters in instrument name must be ASCII and belong to the alphanumeric characters, '_', '.', '-' and '/'"
2024-11-06T21:29:27.832706Z  INFO main self_diagnostics: Shutdown complete. Bye!

o/p after change:

     Running `/home/labhas/obs/ot/lalit/rust/opentelemetry-rust/target/debug/self-diagnostics`
2024-11-06T21:22:23.864454Z  INFO main self_diagnostics: Starting self-diagnostics example
2024-11-06T21:22:23.864738Z ERROR main opentelemetry_sdk:  name="InstrumentCreationFailed" meter_name="example" instrument_name="my_counter with_space" Measurements from this Counter will be ignored. reason="Invalid instrument configuration: characters in instrument name must be ASCII and belong to the alphanumeric characters, '_', '.', '-' and '/'"
2024-11-06T21:22:23.865594Z  INFO main self_diagnostics: Shutdown complete. Bye!

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team as a code owner November 6, 2024 21:40
@codecov
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.4%. Comparing base (ac0ea9f) to head (4762daf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2279   +/-   ##
=====================================
  Coverage   79.4%   79.4%           
=====================================
  Files        121     121           
  Lines      20787   20787           
=====================================
  Hits       16514   16514           
  Misses      4273    4273           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cijothomas cijothomas merged commit 31bea19 into open-telemetry:main Nov 6, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants