-
Notifications
You must be signed in to change notification settings - Fork 889
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
Proposal for pure syntactic sugar event API #2917
Comments
I might argue that this is actually "semantic sugar" rather than "syntactic sugar", but perhaps I've been consuming too much "pedantic sugar" for my own good. |
@jack-berg I suggest we split the events "helper/sugar" API into a separate document to simplify status tracking (avoid Mixed status) and to emphasize the difference and reliance on the logging part. |
I also still see confusion from people that we building a logging API. We need to somehow make it more clear that we don't. One thing we can try after splitting the events part is to rename the "Log API" to "Logging Backend API". The term "backend" appears in new designs (e.g. here) and makes it distinct from "frontend". This distinction perfectly matches what we want to do, we are really building a backend, while refraining from building a frontend. |
Maybe SPI instead of API, since it's not intended for application code. |
I opened an issue to make sure we fix this confusion: #2936 |
I think the approach that @jack-berg proposed in this PR requires that the |
Just making an observation. Some Splunk libraries have already built an Events API using 0-duration spans. We are choosing to represent Events using LogRecord data model as we feel it's a better fit. The LogRecord data model is not so low level and has several optional fields not relevant to the psuedo-signals built on top, but Spans have a duration making it less suitable for representing Events than LogRecords. |
Resolves open-telemetry#2917. Depends on open-telemetry#2940.
Proposal to change the event API to pure syntactic sugar over the log API.
Currently, the event API shows up in two places in the log API:
event_domain
is an optional field, required if you intend to use the resultingLogger
to emit events.event_domain
specified when initializing theLogger
.Alternatively, the event API could just be a wrapper around
Logger
:Sample code here. Sample source for EventLogger.
In this design,
EventLogger
has a concrete implementation rather than being an interface. As a result, there's no ability to have alternative implementations. Can still provide alternative implementations forLogger
, whichEventLogger
delegates to.Advantages include:
EventLogger
and see plainly that it just delegates toLogger
and sets some attributes.I'm not sure there's any existing places where OpenTelemetry provides syntactic sugar like this. The need for such a thing may be unique to the log signal, since logs are a really raw / low level signal upon which other things may be build (i.e. events, and potentially profiles). Its worth thinking about how additional pseudo-signals built on top of logs might manifest if this pattern is adopted and extended to other use cases.
The text was updated successfully, but these errors were encountered: