-
Notifications
You must be signed in to change notification settings - Fork 936
[Logs] Add optional Ergonomic API #4741
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
3f414f0
62a752d
99bb74a
8139964
56f27f8
d3f5fb6
4e5a198
fe8c5fe
b10da75
0bb6e78
3f62fd0
9ad04f2
d42e679
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,7 @@ aliases: [bridge-api] | |||||||||
|
|
||||||||||
| # Logs API | ||||||||||
|
|
||||||||||
| **Status**: [Stable](../document-status.md) | ||||||||||
| **Status**: [Stable](../document-status.md), except where otherwise specified | ||||||||||
|
|
||||||||||
| <details> | ||||||||||
| <summary>Table of Contents</summary> | ||||||||||
|
|
@@ -23,6 +23,7 @@ aliases: [bridge-api] | |||||||||
| * [Enabled](#enabled) | ||||||||||
| - [Optional and required parameters](#optional-and-required-parameters) | ||||||||||
| - [Concurrency requirements](#concurrency-requirements) | ||||||||||
| - [Ergonomic API](#ergonomic-api) | ||||||||||
| - [References](#references) | ||||||||||
|
|
||||||||||
| <!-- tocstop --> | ||||||||||
|
|
@@ -35,7 +36,8 @@ which use this API to bridge between existing logging libraries and the | |||||||||
| OpenTelemetry log data model. | ||||||||||
|
|
||||||||||
| The Logs API can also be directly called by instrumentation libraries | ||||||||||
| as well as instrumented libraries or applications. | ||||||||||
| as well as instrumented libraries or applications. However, languages are also | ||||||||||
| free to provide a more [ergonomic API](#ergonomic-api) for direct usage. | ||||||||||
|
|
||||||||||
| The Logs API consist of these main components: | ||||||||||
|
|
||||||||||
|
|
@@ -167,6 +169,20 @@ specific guarantees and safeties. | |||||||||
|
|
||||||||||
| **Logger** - all methods are safe to be called concurrently. | ||||||||||
|
|
||||||||||
| ## Ergonomic API | ||||||||||
|
|
||||||||||
| **Status**: [Development](../document-status.md) | ||||||||||
|
|
||||||||||
| Languages MAY additionally provide a more ergonomic and convenient logging API | ||||||||||
| that it is better suited for direct usage by instrumentation libraries, | ||||||||||
| instrumented libraries, and applications. | ||||||||||
|
Comment on lines
+176
to
+178
Member
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. nit: just more concise suggestion that avoid repeating all possible API callers
Suggested change
|
||||||||||
|
|
||||||||||
| The ergonomic API SHOULD make it easier to emit logs and events following the | ||||||||||
| [log semantics](https://opentelemetry.io/docs/specs/semconv/general/logs/) | ||||||||||
| and the [event semantics](https://opentelemetry.io/docs/specs/semconv/general/events/). | ||||||||||
|
Comment on lines
+180
to
+182
Member
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'm not sure about all these places that mention log semantic conventions since we're only planning to define semantic conventions for events is the idea that the ergonomic api is just for semantic conventions? or also for classical logging (e.g. templates, parameter substitution, etc), or limited to events + structured logging? |
||||||||||
|
|
||||||||||
| The design of the ergonomic API SHOULD be idiomatic for its language. | ||||||||||
|
|
||||||||||
| ## References | ||||||||||
|
|
||||||||||
| - [OTEP0150 Logging Library SDK Prototype Specification](../../oteps/logs/0150-logging-library-sdk.md) | ||||||||||
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.
we probably don't need a new section just to document something obvious (IMHO) to each language implementations. Languages were always free to offer extra helpers for all sort of things, and I think that is not prohibited in the spec.
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'd like to highlight a few points:
Issue Confusing purpose for logging API #4661 demonstrates real confusion - The contradiction in the opening paragraphs confused contributors. This suggests the freedom isn't as "obvious" as we might think. Moreover, based on the discussions during the specification SIG meeting, others also shared concerns in the current way the specification is written.
The section provides guidance, not just permission - It's not just saying "you can do this" (which may be implicit), but "here's what to focus on when you do this" (semconv compliance, idiomatic design).
Precedent exists - The Configuration spec explicitly states languages should provide idiomatic mechanisms. This follows that pattern.
Small documentation cost, significant clarity benefit - The section is brief (~5 lines) but resolves confusion that led to an issue being filed.
Would you prefer we:
I'm open to alternatives that achieve the clarity goal while addressing your concern about documenting the "obvious."
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.
My preference is : C
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 am fine with C. Let's see wait for more feedback.
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 also updated the
README.mdso that this PR will be self-sufficient for solving the issue.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 today's Spec SIG meeting it seemed that the attendees preference was: A