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

[DO NOT MERGE] Prototype Entities (otep#264) in Java SDK #6855

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jsuereth
Copy link
Contributor

@jsuereth jsuereth commented Nov 7, 2024

This is a prototype of Java SDK updates for Entities OTEP.

  • Adds Entity, EntityBuilder, EntityDetector to sdk common package.
  • Adds entity related methods to Resource and ResourceBuilder. Updates merge logic to match OTEP specification.
  • Creates a ResourceProvider which attempts to centralize Resource/Entity logic. This will need to be sorted out with existing sdk-extension ResourceProviders.
  • Updates unit tests do to auto-generated toString changes.

Note: This prototype does NOT attempt to isolate experimental features into internal directories and expose an experimental package. That would be done when fragmenting this prototype into components and submitting "final" variants w/ specification work.

This does NOT update Resource.merge for entities yet.
This has many inefficiencies that can be optimised away.

- Adds Entity + EntityBuilder for constructing entities in the SDK
- Add EntityDetector for discovering entities
- Moves `service` and `telemetry.sdk` detection to EntityDetectors
- Updates to semconv 1.28.0 for service/telemetry.sdk
- Updates Resource + ResourceBuilder to preserve Entity
- Creates a ResourceProvider that can be used to construct Resource
  using entity merge rules.
- Hacky `getAttributes` update on Resource to preserve existing
  behavior.

Tests pending.
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 79.90196% with 41 lines in your changes missing coverage. Please review.

Project coverage is 90.16%. Comparing base (bc2487f) to head (a24d691).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...o/opentelemetry/sdk/resources/ResourceBuilder.java 55.88% 14 Missing and 1 partial ⚠️
...k/resources/detectors/ServiceInstanceDetector.java 0.00% 13 Missing ⚠️
.../java/io/opentelemetry/sdk/resources/Resource.java 90.24% 4 Missing and 4 partials ⚠️
...lemetry/sdk/resources/ResourceProviderBuilder.java 68.75% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6855      +/-   ##
============================================
- Coverage     90.28%   90.16%   -0.12%     
- Complexity     6588     6640      +52     
============================================
  Files           729      736       +7     
  Lines         19768    19945     +177     
  Branches       1944     1964      +20     
============================================
+ Hits          17847    17984     +137     
- Misses         1327     1362      +35     
- Partials        594      599       +5     

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

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.

1 participant