-
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
Changes from 1 commit
bb4017f
0f1a23f
f38b432
ddd9803
0566788
f845583
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { LogRecord } from './LogRecord'; | ||
|
||
export interface EventLogger { | ||
/** | ||
* Emit a log event. | ||
* | ||
* @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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { EventLogger } from './EventLogger'; | ||
import { Logger } from './Logger'; | ||
import { LoggerProvider } from './LoggerProvider'; | ||
|
||
/** | ||
* A registry for creating named {@link EventLogger}s. | ||
*/ | ||
export interface EventLoggerProvider extends LoggerProvider { | ||
/** | ||
* Returns a EventLogger instance and is responsible for emitting Events as LogRecords. | ||
* | ||
* @param logger the delegate Logger used to emit Events as LogRecords. | ||
* @param domain the domain of emitted events, used to set the event.domain attribute. | ||
*/ | ||
getEventLogger(logger: Logger, domain: string): EventLogger; | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"version": "independent", | ||
"npmClient": "npm", | ||
"useNx": false, | ||
"packages": [ | ||
"api", | ||
"packages/*", | ||
|
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.
Sorry, this is something I forgot to remove when I was doing the sdk implementation validation, I have removed it