-
Notifications
You must be signed in to change notification settings - Fork 828
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
feat(api-logs): split out event api #3501
Conversation
* @param eventName the Event name. | ||
* @param logRecord the LogRecord representing the Event. | ||
*/ | ||
emitLogEvent(eventName: string, logRecord: LogRecord): void; |
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.
Spec uses the name 'emit event' and I think keeping log out of the name makes it less confusing.
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.
Are we using the log record type intentionally? Seems like it should have an event type?
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.
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.
Are we using the log record type intentionally? Seems like it should have an event type?
As above, here is strictly in accordance with the specification too, these two guys go together. If we don't highlight the log, we really need an Event Type. But the two of them are actually one data model. I added a 'type EventRecord = LogRecord' and change api to emitEvent(eventName: string, eventRecord: EventRecord): void;
, here can discuss whether the eventName
should be placed in the EventRecord
type
.gitignore
Outdated
@@ -8,6 +8,9 @@ logs | |||
npm-debug.log* | |||
yarn-debug.log* | |||
yarn-error.log* | |||
# Filter Logs singal files | |||
!experimental/examples/logs | |||
!experimental/packages/otlp-transformer/src/logs |
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.
Why are we filtering in the src directory? Could easily see this backfiring or being confusing if someone tries to make a logs transformer.
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.
Why are we filtering in the src directory? Could easily see this backfiring or being confusing if someone tries to make a logs transformer.
Sorry, this is something I forgot to remove when I was doing the sdk implementation validation, I have removed it
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3501 +/- ##
==========================================
- Coverage 93.74% 93.74% -0.01%
==========================================
Files 249 249
Lines 7593 7592 -1
Branches 1582 1582
==========================================
- Hits 7118 7117 -1
Misses 475 475
|
@fuaiyi Apologies again for the delayed response. There are still ongoing discussions about what the Events API should look like (see open-telemetry/opentelemetry-specification#3086). We discussed this in the Client Instrumentation SIG today, and think that we should postpone making significant changes to the API until we have more clarity. I propose that we close this PR for now. We feel that it is more important to work on the Log SDK implementation. I have started working on that in the past (#3400). And I think you also have an implementation (#3442)? Do you want to (and have capacity to) bring that to conclusion? If not, I can continue on my implementation. If you want to discuss, please attend the Client Instrumentation SIG (or Javascript SIG), or you can also reach out to me on Slack. |
Yes, I also think so. I will close this pr first and make modifications after the event api is confirmed |
Thank you @martinkuba for your reply, Yes, I have completed the implementation of the sdk, regarding the implementation of sdk, I have brought up pr again in recent days. Then we can discuss it together and see if we can adopt it, this can reduce the development cycle and make the sdk available to everyone quickly. I'm sorry that I can't attend the SIG meeting at present, but I will watch the video of the SIG meeting, and if there is any problem, I will see the discussion. I will try to participate in the SIG meeting in the future |
Which problem is this PR solving?
An update to the Logs specification was found during the last pr. It affects the development of code functions. The detailed discussion is here: #3443
This pr implements the latest specifications. The core functionality is to separate out the event api and modify several LogRecord fields to normalize it. Specific details are as follows:
Based on the specification version
open-telemetry/opentelemetry-specification#2941
Content of modification:
EventLogger
EventLoggerProvider
(inherited fromLoggerProvider
, can reuse the provier configuration as a factory for creating theEventLogger
))LogEvent
(it is no longer needed, just use theLogRecord
data model)emitEvent
method (Migrate to theEventLogger
).LoggerOptions
field and deleteeventDomain
(migrate toEventLogger
). AddincludeTraceContext
(a field within the specification that configs the trace context automatically)LogRecord
fields(based on the latest specification ). In addition,timestamp
is replaced withTimeInput
, since it is unnecessary for developers to generateHrTime
, andTimeInput
is also used in the span structure, which is converted byhrTimeToNanoseconds
in the sdkemitEvent
method inNoopLogger
Finally
There are a few issues to discuss
Type of change
Please delete options that are not relevant.
Checklist: