Conversation
| .setSeverityText("DEBUG") | ||
| .setContext(Context.current()) | ||
| .emit(); | ||
| eventLogger.builder("namespace.event-name").put("key", "value").emit(); |
There was a problem hiding this comment.
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.
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.
I think this may be ok now that we're deprioritizing event bodies
There was a problem hiding this comment.
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.
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.
LogRecordBuilderalso 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.
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. |
breedx-splk
left a comment
There was a problem hiding this comment.
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.