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

Rename OTEL_CPP_GET_ATTR macro, and define it using fully qualified attr function. #1140

Merged
merged 3 commits into from
Dec 20, 2021

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Dec 14, 2021

Fixes #1139

Changes

  • Renamed OTEL_CPP_GET_ATTR macros defined for resource and trace into two different sem-ver macros - OTEL_GET_TRACE_ATTR (for trace) and OTEL_GET_RESOURCE_ATTR (for resource). This will avoid name overwriting if both are used in the same application.
  • Define them using the fully qualified attr function.

this may break applications that have been using earlier macros. While existing macros can be kept, it's better to clean up as the impact is minimal.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team December 14, 2021 23:51
@lalitb lalitb changed the title sem ver Rename OTEL_CPP_GET_ATTR macro, and define it using fully qualified attr function. Dec 14, 2021
@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #1140 (a71f5e2) into main (3701a6e) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1140      +/-   ##
==========================================
- Coverage   93.39%   93.38%   -0.01%     
==========================================
  Files         165      165              
  Lines        6229     6230       +1     
==========================================
  Hits         5817     5817              
- Misses        412      413       +1     
Impacted Files Coverage Δ
...y/sdk/resource/experimental_semantic_conventions.h 100.00% <ø> (ø)
sdk/src/resource/resource.cc 96.78% <100.00%> (+0.11%) ⬆️
sdk/test/resource/resource_test.cc 93.81% <100.00%> (ø)
...include/opentelemetry/sdk/common/circular_buffer.h 97.92% <0.00%> (-2.08%) ⬇️

Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

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

LGTM

@lalitb lalitb merged commit 4f5505f into open-telemetry:main Dec 20, 2021
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.

OTEL_CPP_GET_ATTR macro should fully qualify its usage of attr
3 participants