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

Refactor Event API to reflect spec changes #6001

Closed
wants to merge 3 commits into from

Conversation

jack-berg
Copy link
Member

Reflects changes in open-telemetry/opentelemetry-specification#3772 and open-telemetry/opentelemetry-specification#3749.

Summary of changes:

  • event.domain and event.name attributes merged into event.name, which is expected to be namespaced and follow attribute naming rules. The EventEmitterBuilder#setEventDomain method is deleted.
  • Event payload defines what actually occurred in the event. Its represented using an AnyValue type and maps to the log record body. The payload argument is optional, reflecting the fact that some events will only have a event.name.
  • Add EventBuilder#setContext method for optionally overriding the default current context.
  • Add optional SeverityNumber argument, which defaults to INFO=9. This can be used to sample / filter events according to priority.
  • Add EventBuilder#setAttributes method for optionally setting the event attributes. The event payload is expected to be well defined, and the attributes can be used to specify additional information about the context of what occurred.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (531898c) 91.18% compared to head (e1459c6) 91.20%.
Report is 28 commits behind head on main.

❗ Current head e1459c6 differs from pull request most recent head ed93763. Consider uploading reports for the commit ed93763 to get more accurate results

Files Patch % Lines
...entelemetry/sdk/logs/internal/SdkEventBuilder.java 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6001      +/-   ##
============================================
+ Coverage     91.18%   91.20%   +0.02%     
- Complexity     5613     5620       +7     
============================================
  Files           616      618       +2     
  Lines         16566    16579      +13     
  Branches       1642     1643       +1     
============================================
+ Hits          15105    15121      +16     
+ Misses         1013     1008       -5     
- Partials        448      450       +2     

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

@jack-berg
Copy link
Member Author

Marking ready for review as the spec PRs this embodies have been merged.

@jack-berg jack-berg marked this pull request as ready for review December 1, 2023 21:28
@jack-berg jack-berg requested a review from a team December 1, 2023 21:28
Copy link
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

This looks good. I asked about an overload, but we can always add them later. 👍🏻

@jack-berg
Copy link
Member Author

Converted to a draft again because the event sig is actively working out details this PR changes and I want to wait for those discussions to resolve to reduce churn.

@jack-berg
Copy link
Member Author

Closing for the time being until details get hashed out by the event SIG.

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