-
Notifications
You must be signed in to change notification settings - Fork 858
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
Drop event API / SDK #7053
Drop event API / SDK #7053
Conversation
@@ -672,7 +666,6 @@ private static void testLogRecordExporter(LogRecordExporter logRecordExporter) { | |||
.setSeverityText("DEBUG") | |||
.setContext(Context.current()) | |||
.emit(); | |||
eventLogger.builder("namespace.event-name").put("key", "value").emit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally in this PR, I translate any events to the equivalent log record call, rather than deleting. Here I delete because there's already a log record emitted / asserted which contains all the fields the event would
.put("doubleArrKey", 1.0, 2.0) | ||
.put("boolArrKey", true, false) | ||
// Set complex data | ||
.put("key", Value.of(Collections.singletonMap("childKey1", Value.of("value")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventBuilder
had put
overloads which add KeyValue entries to the log record value. Producing the equivalent with LogRecordBuilder
is more cumbersome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be ok now that we're deprioritizing event bodies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogRecordBuilder
also lacks overloads for setting attributes which we see in the span api.
Obviously we'd want to add these as part of an ergonomic / user facing API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be ok now that we're deprioritizing event bodies
Until we land #6983 (or equivalent) the body is the only place you can put complex data as a java user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogRecordBuilder
also lacks overloads for setting attributes which we see in the span api.Obviously we'd want to add these as part of an ergonomic / user facing API.
I'd probably be in favor of adding these overloads in the LogRecordBuilder regardless of the future user facing API, but I don't think there's any rush on this
.logRecordBuilder() | ||
.setEventName("namespace.test-name") | ||
.setSeverity(Severity.INFO) | ||
.setBody(Value.of(io.opentelemetry.api.common.KeyValue.of("cow", Value.of("moo")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We lose a default severity of INFO
set by the event SDK.
Also, as mentioned here, we lose the put
overloads for adding KeyValue entries to the body.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project status has failed because the head coverage (89.97%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7053 +/- ##
============================================
- Coverage 89.95% 89.85% -0.10%
+ Complexity 6668 6608 -60
============================================
Files 748 740 -8
Lines 20105 19972 -133
Branches 1970 1963 -7
============================================
- Hits 18085 17946 -139
- Misses 1427 1438 +11
+ Partials 593 588 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Farewell, old friend. 🌤️
Resoles #7008.
Callers of the event API can recreate the equivalent by calling
((ExtendedILogger) logger).logRecordBuilder()
, albeit at the expense of ergonomics.I'll annotate this PR with notable changes.