-
Notifications
You must be signed in to change notification settings - Fork 887
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
Logs API to be user-facing #4225
Changes from 20 commits
45f6847
ffe4a1b
4dadc75
90610d2
452f61b
4ab9a0a
76c4644
daaaa1f
7c609c0
847b691
3ea0a68
1409d01
bbc8ab1
3b32a2d
71c0986
22d628d
de72b99
beff5c5
6e2511d
ba78baa
d3aefef
cc0f262
47468d4
d286fc2
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 |
---|---|---|
|
@@ -140,16 +140,18 @@ Given the above state of the logging space we took the following approach: | |
OpenTelemetry log data model. OpenTelemetry Collector can read such logs and | ||
translate them to OpenTelemetry log data model. | ||
|
||
- OpenTelemetry defines a Logs Bridge API | ||
for [emitting LogRecords](./bridge-api.md#emit-a-logrecord). Application developers are | ||
NOT encouraged to call this API directly. It is provided for library authors | ||
to build [log appender](../glossary.md#log-appender--bridge), which use | ||
the API to bridge between existing logging libraries and the OpenTelemetry log | ||
data model. Existing logging libraries generally provide a much richer set of | ||
features than what is defined in OpenTelemetry. It is NOT a goal of | ||
OpenTelemetry to ship a feature-rich logging library. | ||
|
||
- OpenTelemetry defines an [SDK](./sdk.md) implementation of the [Bridge API](./bridge-api.md), | ||
- OpenTelemetry defines a Logs API for [emitting LogRecords](./api.md#emit-a-logrecord). | ||
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. This NEEDS to include comments about also emitting events as that is the intention 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. It is described in API and Data Model. Do we need to repeat it? Can you suggest a change? |
||
It is provided for library authors to build [log appenders](../glossary.md#log-appender--bridge), | ||
which use the API to bridge between existing logging libraries and the | ||
OpenTelemetry log data model. | ||
The [API](./api.md) is also provided for instrumentation libraries to emit log | ||
records following semantic conventions (also known as OpenTelemetry Events). | ||
pellared marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Existing logging libraries generally provide a much richer set of features | ||
than what is defined in OpenTelemetry. It is NOT a goal of OpenTelemetry to | ||
ship a feature-rich logging library. However, nothing prevents application | ||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
developers to use it directly. | ||
|
||
- OpenTelemetry defines an [SDK](./sdk.md) implementation of the [API](./api.md), | ||
which enables configuration of [processing](./sdk.md#logrecordprocessor) | ||
and [exporting](./sdk.md#logrecordexporter) LogRecords. | ||
|
||
|
@@ -230,10 +232,9 @@ processor. | |
### Infrastructure Logs | ||
|
||
These are logs generated by various infrastructure components, such as | ||
Kubernetes events (if you are wondering why events are discussed in the context | ||
of logs see [Event API Data model](./event-api.md#event-data-model)). Like system logs, the | ||
infrastructure logs lack a trace context and can be enriched by the resource | ||
context - information about the node, pod, container, etc. | ||
Kubernetes events. Like system logs, the infrastructure logs lack a trace | ||
context and can be enriched by the resource context - information about | ||
the node, pod, container, etc. | ||
|
||
OpenTelemetry Collector or other agents can be used to query logs from most | ||
common infrastructure controllers. | ||
|
@@ -359,7 +360,7 @@ as parsers, log tailing and rotation. It also enables the possibility to send | |
logs directly to the logging backend without using a log collection agent. | ||
|
||
To facilitate both approaches described above OpenTelemetry provides | ||
a [Bridge API](./bridge-api.md) and [SDK](./sdk.md), which can be used together with existing | ||
a [API](./api.md) and [SDK](./sdk.md), which can be used together with existing | ||
logging libraries to automatically inject the trace context in the emitted logs, | ||
and provide an easy way to send the logs via OTLP. Instead of | ||
modifying each logging statement, [log appenders](../glossary.md#log-appender--bridge) | ||
|
@@ -444,10 +445,9 @@ standard output. | |
|
||
## Specifications | ||
|
||
* [Logs Bridge API](./bridge-api.md) | ||
* [Logs API](./api.md) | ||
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. How about having links to the old API's stating that the this new API will encompass the existing functionality. 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. I do not want to create yet another API. |
||
* [Logs SDK](./sdk.md) | ||
* [Logs Data Model](./data-model.md) | ||
* [Event API](./event-api.md) | ||
* [Trace Context in non-OTLP Log Formats](../compatibility/logging_trace_context.md) | ||
|
||
## References | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||||
# Logs Bridge API | ||||||||
# Logs API | ||||||||
|
||||||||
**Status**: [Stable](../document-status.md), except where otherwise specified | ||||||||
|
||||||||
|
@@ -9,6 +9,7 @@ | |||||||
|
||||||||
<!-- toc --> | ||||||||
|
||||||||
- [Overview](#overview) | ||||||||
- [LoggerProvider](#loggerprovider) | ||||||||
* [LoggerProvider operations](#loggerprovider-operations) | ||||||||
+ [Get a Logger](#get-a-logger) | ||||||||
|
@@ -18,21 +19,32 @@ | |||||||
+ [Enabled](#enabled) | ||||||||
- [Optional and required parameters](#optional-and-required-parameters) | ||||||||
- [Concurrency requirements](#concurrency-requirements) | ||||||||
- [Artifact Naming](#artifact-naming) | ||||||||
- [Convenience](#convenience) | ||||||||
- [Logs Bridge API](#logs-bridge-api) | ||||||||
- [References](#references) | ||||||||
|
||||||||
<!-- tocstop --> | ||||||||
|
||||||||
</details> | ||||||||
|
||||||||
<b>Note: this document defines a log *backend* API. The API is not intended | ||||||||
to be called by application developers directly. It is provided for logging | ||||||||
library authors to build | ||||||||
[log appenders](./supplementary-guidelines.md#how-to-create-a-log4j-log-appender), | ||||||||
## Overview | ||||||||
|
||||||||
This document defines a log API. | ||||||||
|
||||||||
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 part of OTep #265 it was determined that there SHOULD be a public facing "Logging" API to enable the emitting of "Events" (as a type of OpenTelemetry Log) as well as other general "Logs" <- I'm implicitly inferring based on discussions that occurred as part of #265 (ie. while all One of the key words here is These can include "Event", "Audit", "Security", "Transaction", "Message", "Server", "File" and many, many more, and just as "Events are a As part of any Logging API we SHOULD provide a front-end API and guidance for all of the CORE fundamental concepts to "try" to make it clear about what will and won't occur when you do or don't use the specific API. 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. I changed the PR so that Logs API can be used to emit events but I have not removed the Events API. |
||||||||
The API serves following use cases. | ||||||||
|
||||||||
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 are many additional features / requirements that exist and are yet to be defined as we move this API forward (some of which was starting to occur in the Event API) as it was moving (or trying to move) towards stability. 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. I think this should rather require refining the SDK and not the API. |
||||||||
It is provided for logging library authors to build | ||||||||
[log appenders/bridges](./supplementary-guidelines.md#how-to-create-a-log4j-log-appender), | ||||||||
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. @MSNev can you highlight any specific blocking concerns you have about this PR beyond #4225 (comment), and open tracking issues for the rest? Once we get this initial restructuring PR landed then we'll be able to start sending PRs to try to address those. Thanks. 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. It is up to the bridge implementation how the logging library would be mapped to OTel Logs Data Model. I think we should rather create some "guidance" / "recommendations" for log bridge authors. We cannot control how the bridges are going to be implemented. For sure this should be out of scope of this PR. |
||||||||
which use this API to bridge between existing logging libraries and the | ||||||||
OpenTelemetry log data model.</b> | ||||||||
OpenTelemetry log data model. See also: [Logs Bridge API](#logs-bridge-api) | ||||||||
|
||||||||
It is provided for (instrumentation) libraries to emit | ||||||||
[OpenTelemetry Events](data-model.md#events). | ||||||||
|
||||||||
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. I believe by making Otel Logs API user-facing, we should not limit instrumentation to events. It should be fine to emit nameless log records. So maybe
Suggested change
? 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.
ABSOLUTELY! And whether that are called "nameless" or there is some other "name" (not 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. It is about OTel instrumentation libraries (not any "instrumentation").
The next paragraph is about using the API to emit any logs. 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. And both of those links talked about them be "represented" by the same Data Model, or as a "type" of Log, it is NOT stating that this makes them the SAME thing (beyond the transport / representation), they still HAVE different Semantics. What is an Event https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md Nowhere is it saying that a Log is an Event 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. And as an example of additional cases where I'm saying that we are talking past each other on the possible solutions, Nothing over there was "simply" ranting, it was about trying to inform and provide workable solutions that will work for ALL of US and the community. 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.
How would the instrumentation library report a problem if the OTel Logs Provider is not configured? Some OTel libraries have already some ways to report problems. E.g. in Go we have https://pkg.go.dev/go.opentelemetry.io/otel#SetErrorHandler. I am not against the idea, but I think it would increase the impact (and scope) of this PR. How about a separate issue after this one is (hopefully) merged? 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.
it won't - I mean someone could configure default provider (stdout), but in general case if you use 3rd party logging library, it's not a responsibility of something that emits logs to notify you that your logging provider is not configured. We can borrow some ideas from logging libs. E.g. SLF4J notifies you if provider is not configured with something like this in stderr: I agree that it's not a viable choice for instrumentation today to rely on OTel logs being configured as a main source of logging, but 3 years from now it could be a nice option to report all telemetry with otel instead of taking dependency on something else. And we're not restricting anything - we're adding more options. In any case, I'd like to have this discussion tomorrow on the spec call, but if you feel strongly about making progress on this PR without addressing it, I'm fine doing it as a follow up. 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. I created #4234 please feel free to update the description to make it more complete 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.
I think this is a good example. You can emit an untyped event (which is a nameless logrecord), and it would bypass any event pipelines set up, but it would still give you a single api surface at the low level. 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. BTW @pellared my main focus with this is native instrumentations where now I need to pick one API for logging and use OTel for everything else. I.e. I don't mean instrumentation logs, I mean the underlying library logs. |
||||||||
The Logs Bridge API consist of these main components: | ||||||||
It is provided for application developers to emit structured log records | ||||||||
(including OpenTelemetry Events). | ||||||||
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. This should call out the "difference" between the processing / handling / semantics of an
Problem Statement and confusion
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.
I find it as out of scope. We need such mechanism for all log records. From last SIG meeting agenda:
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. Am I stating anywhere that we don't -- NO. 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. based on the current version of spec, it's totally valid to emit events using log bridge. We don't have a requirement to support separate pipelines today and this PR does not change status quo opentelemetry-specification/specification/logs/event-api.md Lines 79 to 81 in fbaf846
|
||||||||
|
||||||||
The Logs API consists of these main components: | ||||||||
|
||||||||
* [LoggerProvider](#loggerprovider) is the entry point of the API. It provides access to `Logger`s. | ||||||||
* [Logger](#logger) is responsible for emitting logs as | ||||||||
|
@@ -167,21 +179,23 @@ provide it. | |||||||
|
||||||||
## Concurrency requirements | ||||||||
|
||||||||
For languages which support concurrent execution the Logs Bridge APIs provide | ||||||||
For languages which support concurrent execution the Logs APIs provide | ||||||||
specific guarantees and safeties. | ||||||||
|
||||||||
**LoggerProvider** - all methods are safe to be called concurrently. | ||||||||
|
||||||||
**Logger** - all methods are safe to be called concurrently. | ||||||||
|
||||||||
## Artifact Naming | ||||||||
## Convenience | ||||||||
|
||||||||
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. This is PART of the issue with this process. Events are MORE than just a Convenience!I would be fine with wording along the lines of For languages that do not need or want to provide any OpenTelemetry Event support because they have their own native or common libraries, then they MAY choose to not implement the 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.
I find this as an opinionated statement based on the current definition of Opentelemetry Events 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.
And THAT is the crux of the disagreementYou (and several others) DON'T believe and either DON'T understand or WANT to understand that "Events" are NOT JUST Logs, so your Opinionated view / statement is to remove something that you DON'T understand. As stated in the Oel (this portion I agree with)
They are a TYPE of Log, it does not state that ALL Logs are Events and it does not state the there is ONLY 1 TYPE of Log (Events). Calling Every LOG and That does not mean that there isn't room to "define" the appropriate Semantics to keep Both, but that is the discussions and part of the agreements that we need to make BEFORE we can conclude this PR (as I've mentioned eariler) 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. Could we call this section "Optional methods" so it works for everyone? 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. I would rather remove the whole section. I think it is needed not only for sake of events but e.g. Java may want to have convenient methods like
Nobody does it. Currently, just call every log with 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. Another problem, I see in defining PS. The same problem currently exists in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/event-api.md#emit-event 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. |
||||||||
Languages MAY provide additional ergonomics and convinence APIs. For instance, | ||||||||
a language may provide an `Emit an Event` method that requires passing | ||||||||
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.
Suggested change
|
||||||||
an event name parameter. | ||||||||
|
||||||||
## Logs Bridge API | ||||||||
|
||||||||
The Logs Bridge API is not intended to be called by application developers | ||||||||
directly, and SHOULD include documentation that discourages direct use. However, | ||||||||
in the event OpenTelemetry were to add a user facing API, the Logs Bridge API would | ||||||||
be a natural starting point. Therefore, Log Bridge API artifact, package, and class | ||||||||
names MUST NOT include the terms "bridge", "appender", or any other qualifier | ||||||||
that would prevent evolution into a user facing API. | ||||||||
Languages MAY provide a separate Logs Bridge API if they need different | ||||||||
ergonomics for consumers that are building log appenders/bridges. | ||||||||
|
||||||||
## References | ||||||||
|
||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -33,6 +33,7 @@ | |||||||||||
* [Field: `InstrumentationScope`](#field-instrumentationscope) | ||||||||||||
* [Field: `Attributes`](#field-attributes) | ||||||||||||
+ [Errors and Exceptions](#errors-and-exceptions) | ||||||||||||
* [Events](#events) | ||||||||||||
- [Example Log Records](#example-log-records) | ||||||||||||
- [Example Mappings](#example-mappings) | ||||||||||||
- [References](#references) | ||||||||||||
|
@@ -466,6 +467,28 @@ of the record. | |||||||||||
If included, they MUST follow the OpenTelemetry | ||||||||||||
[semantic conventions for exception-related attributes](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md). | ||||||||||||
|
||||||||||||
### Events | ||||||||||||
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. should this section be marked with stability |
||||||||||||
|
||||||||||||
Wikipedia’s [definition of log file](https://en.wikipedia.org/wiki/Log_file): | ||||||||||||
|
||||||||||||
>In computing, a log file is a file that records either events that occur in an | ||||||||||||
>operating system or other software runs. | ||||||||||||
|
||||||||||||
From OpenTelemetry's perspective LogRecords and Events are both represented | ||||||||||||
using the same [data model](./data-model.md). An Event is a specialized type | ||||||||||||
of LogRecord, not a separate concept. | ||||||||||||
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. Remove the From OpenTelemetry's perspective LogRecords and Events are both represented 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. No. This is an extract from Events API. I have not changed a single word. Out of scope. 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. In the framing of the Event API as a separate entity and therefore the creation and sending of the resulting Event as a 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 of today's understanding of the specification) They are not. Event is a specialization of a LogRecord. I never have seen in spec that Events and Logs are separate signals (this would mean for me that these are separate concepts). |
||||||||||||
|
||||||||||||
Events are OpenTelemetry's standardized semantic formatting for LogRecords. | ||||||||||||
Beyond the structure provided by the LogRecord data model, it is helpful for | ||||||||||||
logs to have a common format within that structure. When OpenTelemetry | ||||||||||||
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. And this is the crux of the problem
While Events are represented as 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. I do not follow what this comment is about 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. Again the crux of the issue that needs to be discussed during the meeting 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. See not just my comments but also @jkwatson open-telemetry/oteps#265 (comment) in the OTep. 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. It seems to be a copy-paste from the existing opentelemetry-specification/specification/logs/event-api.md Lines 44 to 48 in fbaf846
but I wonder if we should allow instrumentations to emit logs or events now that logging api is going to be user-facing. Left another comment on it - https://github.com/open-telemetry/opentelemetry-specification/pull/4225/files#r1781573289 |
||||||||||||
instrumentation emits logs, those logs SHOULD be formatted as Events. All | ||||||||||||
semantic conventions defined for logs MUST be formatted as Events. | ||||||||||||
|
||||||||||||
The Event format is as follows. All Events have a | ||||||||||||
[`event.name` attribute](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md), | ||||||||||||
and all Events with the same `event.name` MUST conform to the same schema for | ||||||||||||
both their `Attributes` and their `Body`. | ||||||||||||
|
||||||||||||
## Example Log Records | ||||||||||||
|
||||||||||||
For example log records see | ||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,7 +9,6 @@ | |||||||||||||||
|
||||||||||||||||
<!-- toc --> | ||||||||||||||||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
|
||||||||||||||||
- [Event Data model](#event-data-model) | ||||||||||||||||
- [Event API use cases](#event-api-use-cases) | ||||||||||||||||
- [EventLoggerProvider](#eventloggerprovider) | ||||||||||||||||
* [EventLoggerProvider operations](#eventloggerprovider-operations) | ||||||||||||||||
|
@@ -30,35 +29,13 @@ The Event API consists of these main components: | |||||||||||||||
provides access to `EventLogger`s. | ||||||||||||||||
* [EventLogger](#eventlogger) is the component responsible for emitting events. | ||||||||||||||||
|
||||||||||||||||
## Event Data model | ||||||||||||||||
|
||||||||||||||||
Wikipedia’s [definition of log file](https://en.wikipedia.org/wiki/Log_file): | ||||||||||||||||
|
||||||||||||||||
>In computing, a log file is a file that records either events that occur in an | ||||||||||||||||
>operating system or other software runs. | ||||||||||||||||
|
||||||||||||||||
From OpenTelemetry's perspective LogRecords and Events are both represented | ||||||||||||||||
using the same [data model](./data-model.md). An Event is a specialized type | ||||||||||||||||
of LogRecord, not a separate concept. | ||||||||||||||||
|
||||||||||||||||
Events are OpenTelemetry's standardized semantic formatting for LogRecords. | ||||||||||||||||
Beyond the structure provided by the LogRecord data model, it is helpful for | ||||||||||||||||
logs to have a common format within that structure. When OpenTelemetry | ||||||||||||||||
instrumentation emits logs, those logs SHOULD be formatted as Events. All | ||||||||||||||||
semantic conventions defined for logs MUST be formatted as Events. | ||||||||||||||||
|
||||||||||||||||
The Event format is as follows. All Events have a | ||||||||||||||||
[`event.name` attribute](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md), | ||||||||||||||||
and all Events with the same `event.name` MUST conform to the same schema for | ||||||||||||||||
both their `Attributes` and their `Body`. | ||||||||||||||||
|
||||||||||||||||
## Event API use cases | ||||||||||||||||
|
||||||||||||||||
The Events API was designed to allow shared libraries to emit high quality | ||||||||||||||||
logs without needing to depend on a third party logger. Unlike the | ||||||||||||||||
[Logs Bridge API](./bridge-api.md), instrumentation authors and application | ||||||||||||||||
developers are encouraged to call this API directly. It is appropriate to | ||||||||||||||||
use the Event API when these properties fit your requirements: | ||||||||||||||||
The Events API was designed to allow shared libraries to emit | ||||||||||||||||
[events](data-model.md#events) without needing to depend on a third party logger. | ||||||||||||||||
Comment on lines
+34
to
+35
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. Perhaps this part is changing now. Maybe
Suggested change
? Or maybe just remove this sentence? 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. LGTM. We can the apply your suggestion if there are no counter arguments. 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. It was designed to emit named and structured EVENTS that happen to be sent / represented as a 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. @MSNev can you make a suggestion that would work for you? The original sentence is no longer applicable, what would be a good replacement? 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. But they are still logs 😉 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. Why is it no longer applicable, the original sentence is still valid. If the Events API is being merged into a new common Log API then nothing has changed. 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. I think it's not relevant since with this PR we will have user-facing logging API. I.e. the second part of this sentence no longer makes sense: "The Events API was designed to allow shared libraries to emit events without needing to depend on a third party logger" 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. Then maybe
Suggested change
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. this sounds precise and resolves my concern. I feel this statement ("X API was designed to .. emit X") does not carry any useful information though😄 but if you believe that it does, I don't have any objections against it |
||||||||||||||||
Instrumentation authors and application developers are encouraged can call this | ||||||||||||||||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
API directly. It is appropriate to use the Event API when these properties fit | ||||||||||||||||
your requirements: | ||||||||||||||||
|
||||||||||||||||
* Logging from a shared library that must run in many applications. | ||||||||||||||||
* A semantic convention needs to be defined. We do not define semantic | ||||||||||||||||
|
@@ -80,6 +57,8 @@ If a logging library is capable of creating logs which correctly map | |||||||||||||||
to the Event data model, logging in this manner is also an acceptable way to | ||||||||||||||||
create Events. | ||||||||||||||||
|
||||||||||||||||
Emitting events via [Logs API](api.md) is also acceptable. | ||||||||||||||||
|
||||||||||||||||
## EventLoggerProvider | ||||||||||||||||
|
||||||||||||||||
`EventLogger`s can be accessed with a `EventLoggerProvider`. | ||||||||||||||||
|
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.
No, this PR should be about either
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.
creating a new
logs/api.md
and leaving both the existing (stable)logs/bridge-api.md
and (experimental)logs/event-api.md
alone sounds like a good path forward.the
logs/api.md
page can explain that one of its goals is to replace the Event API and possibly also the Bridge API.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 would prefer not creating yet another API. The specification was foreseeing that Logs Bridge API may be evolved into Logs API. I thing that having them separated in the specification will make it harder to follow and maintain. This is the main motivation behind this PR.
I strongly prefer having a separate, alternate PR instead of changing this one. @MSNev, can you create a new PR?
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.
makes sense, do you think we need to change the page to Mixed stability and call out anything?
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.
If there are good reasons to have the changes as Development then yes. I did my best to limit the scope so that it may be seen as acceptable in the Stable portion of the specification.
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.
Maybe I should mark Convenience section as Development as this is a new "functional' addition to logs. The rest is more about the purpose of the API.
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've added a topic to tomorrow's Spec SIG agenda: