-
Notifications
You must be signed in to change notification settings - Fork 839
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
Semantic sugar Event API #4961
Semantic sugar Event API #4961
Conversation
Codecov ReportBase: 91.05% // Head: 91.05% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4961 +/- ##
============================================
- Coverage 91.05% 91.05% -0.01%
- Complexity 4805 4834 +29
============================================
Files 544 547 +3
Lines 14305 14446 +141
Branches 1367 1393 +26
============================================
+ Hits 13026 13154 +128
- Misses 882 891 +9
- Partials 397 401 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
api/logs/src/main/java/io/opentelemetry/api/events/EventLogger.java
Outdated
Show resolved
Hide resolved
api/logs/src/main/java/io/opentelemetry/api/events/EventLogger.java
Outdated
Show resolved
Hide resolved
👍 💯 |
api/logs/src/main/java/io/opentelemetry/api/events/EventLogger.java
Outdated
Show resolved
Hide resolved
* } | ||
* }</pre> | ||
*/ | ||
public final class EventLogger { |
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.
During the java SIG meeting, it was widely agreed that this name is not great, and that EventEmitter
might be preferable.
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.
Perhaps this should be made an interface.
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.
Perhaps this should be made an interface.
That suggests alternative implementations. The current was to use one of these is something like:
LoggerProvider loggerProvider = ... // Configure a logger provider
Logger logger = loggerProvider.get("my-logger");
EventEmitter eventEmitter = EventLogger.create(logger, "my-event-domain");
What kind of workflow did you have in mind that would allow for alternative implementations to be plugged in?
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 know that we are far away from implementing events independently from logs, and this might even never happen. But I don't agree that alternative implementations must exist in order to define an interface.
I hope that a new interface will help emphasize that events are conceptually different than logs.
And the new interface will at least allow us to provide a different implementation in the future without any breaking changes - even if this is hypothetical at this point.
one thing I liked about @jkwatson's question about making Event API a "full-fledged" API with providers, etc, is I think that would allow the API surface not to mention logs anywhere |
* particular event domain, event name defines a particular class or type of event. | ||
* @return an {@link EventLogger} instance | ||
*/ | ||
public static EventLogger create(Logger logger, String eventDomain) { |
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 suggest naming it fromLogger
.
Would you extend that to having a dedicated event SDK implementation and OTLP representation as well? If so, that's quite a lot of extra code to maintain which would be nearly identical to logs. If not, then users are still eventually confronted with the notion of logs and events being the same thing - just either when they configure the SDK or wherever they receive OTLP. I like the idea of the obvious event API dependency on the log API because it makes it clear as far upstream as possible that events are just a log record with specific characteristics. I wouldn't mind if events were different at the API, SDK, and OTLP level, but think that's a longshot. So in the absence of completely separate log and event signals, better to make their relationship obvious rather than hiding it in the SDK or in OTLP for users to be surprised by later. |
No
For Java agent users, they just point to the OTLP ingestion endpoint, I'm not sure they ever have to be confronted with the notion that logs and events are the same thing at the transport layer. |
Java agent users don't need to know about the API or SDK either. So I suppose its instrumentation authors and end users directly using the API / SDK that we're designing around. |
my particular selfish interest is customers using the Java agent who want to emit custom events |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Java agent users should definitely know about the API. We should encourage the creation of custom spans, metrics and events, all of which require knowledge of the APIs. |
Agreed. Java agent users don't need to know about the API / SDK, but many will. That statement originated further up in the conversation here, where I argued that if events end up using the OTLP log transport, users have to eventually be confronted with the fact that events are just a particular type of log. Better to be confronted as soon as possible in the API than in the SDK:
|
I've been trying to argue the opposite of this. I don't think anyone (aside from operators) should have to care about the weird fact that we happened to use the log datamodel to represent events. When writing instrumentation that generates events, that seems like it should be considered an implementation detail that would depend on how the operator's choice of backend has decided to deal with them. |
Right so would you imagine a fully separate event SDK in addition to a separate event API? If only the API is to be separate, then users configuring the log SDK have to be aware that its handling both logs and events. |
SDK configurers (what I was referring to the "operator" above) definitely need to know. I would hope that API users wouldn't need to be concerned with this implementation detail. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Implements the recent change to to the specification to split out the Event API: open-telemetry/opentelemetry-specification#2941
Event API is split out into new module
:extensions:event-api
which will publish artifact with idopentelemetry-extension-event-api
.