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

[EXPORTER] add instrumentation scope attributes to otlp proto messages for traces and metrics #3185

Conversation

dbarker
Copy link
Contributor

@dbarker dbarker commented Dec 4, 2024

Fixes #3184

Changes

Please provide a brief description of the changes here.

  • Adds a new overload of the PopulateAttribute method to set attributes on the proto::common::v1::InstrumentationScope object in otlp_populate_attribute_utils.h
  • Sets the instrumentation scope attributes of proto::common::v1::InstrumentationScope in the OtlpRecordableUtils::PopulateRequest method for traces.
  • Sets the instrumentation scope attributes in proto::common::v1::InstrumentationScope in the OtlpMetricUtils::PopulateResourceMetrics method for metrics
  • Updates the following test files to check that instrumentation scope attributes are set
    • otlp_file_exporter_test.cc
    • otlp_file_metric_exporter_test.cc
    • otlp_metrics_serialization_test.cc
    • otlp_recordable_test.cc
  • Fixes a bug found with the new tests where the schemaUrl for the metrics instrumentation scope was being set to the schemaUrl for metrics resource.

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

Copy link

linux-foundation-easycla bot commented Dec 4, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit ffe966d
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67538e271662760008a9a7f6

@dbarker dbarker force-pushed the fix_otlp_exporter_instrumentation_scope_attributes branch from 809fc1b to 2f0740f Compare December 4, 2024 02:07
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.86%. Comparing base (2d80c18) to head (ffe966d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3185   +/-   ##
=======================================
  Coverage   87.86%   87.86%           
=======================================
  Files         195      195           
  Lines        6153     6153           
=======================================
  Hits         5406     5406           
  Misses        747      747           

@dbarker dbarker force-pushed the fix_otlp_exporter_instrumentation_scope_attributes branch from d6317b5 to e04755b Compare December 5, 2024 01:32
@dbarker dbarker force-pushed the fix_otlp_exporter_instrumentation_scope_attributes branch from e04755b to dc98669 Compare December 5, 2024 01:40
@dbarker dbarker changed the title [OTLP EXPORTER] include instrumentation scope attributes in otlp trace and metrics [OTLP EXPORTER] add instrumentation scope attributes to otlp proto messages for traces and metrics Dec 5, 2024
@dbarker dbarker changed the title [OTLP EXPORTER] add instrumentation scope attributes to otlp proto messages for traces and metrics [EXPORTER] add instrumentation scope attributes to otlp proto messages for traces and metrics Dec 5, 2024
@dbarker dbarker marked this pull request as ready for review December 5, 2024 03:36
@dbarker dbarker requested a review from a team as a code owner December 5, 2024 03:36
@dbarker
Copy link
Contributor Author

dbarker commented Dec 6, 2024

I've updated this PR with more tests and its passing CI. Ready for review.

@lalitb lalitb added the pr:please-review This PR is ready for review label Dec 6, 2024
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

One minor comment to address, with approval to follow.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

Nice work.

Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@marcalff marcalff merged commit 6218a24 into open-telemetry:main Dec 7, 2024
57 checks passed
@dbarker dbarker deleted the fix_otlp_exporter_instrumentation_scope_attributes branch December 7, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-review This PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracer and meter instrumentation scope attributes not included with otlp exporters
4 participants