Skip to content

Align log sdk naming with api#2768

Merged
tigrannajaryan merged 6 commits intoopen-telemetry:mainfrom
jack-berg:rename-log-emitter
Sep 13, 2022
Merged

Align log sdk naming with api#2768
tigrannajaryan merged 6 commits intoopen-telemetry:mainfrom
jack-berg:rename-log-emitter

Conversation

@jack-berg
Copy link
Copy Markdown
Member

Resolves #2752.

This aligns log SDK and API concepts which have diverged after the merged of #2676. This PR brings alignment to the log API and SDK, and in brings the log signal into alignment with tracing and metrics where there is conceptual overlap. There shouldn't be any new concepts introduced here.

  • Rename ../logs/logging-library-sdk.md to ../logs/sdk.md
  • Remove wording from SDK that implies that an API doesn't exist, like this.
  • Move How to Create Log4j Style Appender to api.md since it describes an API use case.
  • Move Implicit / Explicit Context Injection sections to api.md since they describe API level considerations.
  • Rename Logger create method to be emit, to align with SDK concept of LogRecordProcessor#onEmit(..).
  • Rename LogProcessor, LogExporter to LogRecordProcessor, LogRecordExporter.
  • Fill in various SDK level TODOs related to shutdown and flushing. The language from these was taken directly from the metrics / tracing SDK - no new concepts were introduced.

@jack-berg jack-berg requested review from a team September 1, 2022 18:06
Comment thread specification/logs/api.md
Comment thread specification/logs/api.md Outdated
Copy link
Copy Markdown
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

Comment thread spec-compliance-matrix.md
Comment thread specification/common/attribute-type-mapping.md Outdated
Comment thread specification/logs/api.md Outdated
Comment thread specification/logs/api.md
Comment thread specification/logs/api.md Outdated
Comment thread specification/logs/api.md Outdated
Comment thread specification/logs/api.md
@reyang reyang added spec:logs Related to the specification/logs directory area:sdk Related to the SDK labels Sep 2, 2022
Comment thread specification/logs/api.md Outdated
Comment thread specification/logs/api.md Outdated
@tigrannajaryan
Copy link
Copy Markdown
Member

I will keep this open for a bit to allow time to review the last changes.

@tigrannajaryan tigrannajaryan merged commit d710123 into open-telemetry:main Sep 13, 2022
Comment thread specification/logs/api.md
Comment on lines +151 to +152
Events require the `event.domain` attribute. The API MUST not allow creating an
Event if the Logger instance doesn't have `event.domain` scope attribute.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jack-berg @scheler

Events require the event.domain attribute. The API MUST not allow creating an
Event if the Logger instance doesn't have event.domain scope attribute.

Can you clarify for me what to do in the case of missing event.domain to the EmitEvent call? Is it a no-op or a throw? Do I generate a log to alert the user?

Also, is it valid if name is passed as null or empty?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodeBlanch both domain and name are required for an Event and also cannot be empty or null. So EmitEvent call should throw an error if event.domain attribute is missing or is null/empty. Same with name - if it is null or empty, EmitEvent should return failure or throw an error.

carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
Resolves open-telemetry#2752.

This aligns log SDK and API concepts which have diverged after the merged of open-telemetry#2676. This PR brings alignment to the log API and SDK, and in brings the log signal into alignment with tracing and metrics where there is conceptual overlap. There shouldn't be any new concepts introduced here.

- Rename `../logs/logging-library-sdk.md` to `../logs/sdk.md`
- Remove wording from SDK that implies that an API doesn't exist, like [this](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L60-L62).
- Move [How to Create Log4j Style Appender](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L219) to `api.md` since it describes an API use case.
- Move [Implicit / Explicit Context Injection](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L270-L288) sections to `api.md` since they describe API level considerations.
- Rename Logger [create](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/api.md#L133) method to be emit, to align with SDK concept of `LogRecordProcessor#onEmit(..)`.
- Rename `LogProcessor`, `LogExporter` to `LogRecordProcessor`, `LogRecordExporter`. 
- Fill in various SDK level TODOs related to shutdown and flushing. The language from these was taken directly from the metrics / tracing SDK - no new concepts were introduced.
schmikei pushed a commit to schmikei/opentelemetry-specification that referenced this pull request Apr 17, 2025
Resolves open-telemetry#2752.

This aligns log SDK and API concepts which have diverged after the merged of open-telemetry#2676. This PR brings alignment to the log API and SDK, and in brings the log signal into alignment with tracing and metrics where there is conceptual overlap. There shouldn't be any new concepts introduced here.

- Rename `../logs/logging-library-sdk.md` to `../logs/sdk.md`
- Remove wording from SDK that implies that an API doesn't exist, like [this](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L60-L62).
- Move [How to Create Log4j Style Appender](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L219) to `api.md` since it describes an API use case.
- Move [Implicit / Explicit Context Injection](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L270-L288) sections to `api.md` since they describe API level considerations.
- Rename Logger [create](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/api.md#L133) method to be emit, to align with SDK concept of `LogRecordProcessor#onEmit(..)`.
- Rename `LogProcessor`, `LogExporter` to `LogRecordProcessor`, `LogRecordExporter`.
- Fill in various SDK level TODOs related to shutdown and flushing. The language from these was taken directly from the metrics / tracing SDK - no new concepts were introduced.
schmikei pushed a commit to schmikei/opentelemetry-specification that referenced this pull request Apr 17, 2025
Resolves open-telemetry#2752.

This aligns log SDK and API concepts which have diverged after the merged of open-telemetry#2676. This PR brings alignment to the log API and SDK, and in brings the log signal into alignment with tracing and metrics where there is conceptual overlap. There shouldn't be any new concepts introduced here.

- Rename `../logs/logging-library-sdk.md` to `../logs/sdk.md`
- Remove wording from SDK that implies that an API doesn't exist, like [this](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L60-L62).
- Move [How to Create Log4j Style Appender](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L219) to `api.md` since it describes an API use case.
- Move [Implicit / Explicit Context Injection](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/logging-library-sdk.md#L270-L288) sections to `api.md` since they describe API level considerations.
- Rename Logger [create](https://github.com/open-telemetry/opentelemetry-specification/blame/main/specification/logs/api.md#L133) method to be emit, to align with SDK concept of `LogRecordProcessor#onEmit(..)`.
- Rename `LogProcessor`, `LogExporter` to `LogRecordProcessor`, `LogRecordExporter`.
- Fill in various SDK level TODOs related to shutdown and flushing. The language from these was taken directly from the metrics / tracing SDK - no new concepts were introduced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sdk Related to the SDK spec:logs Related to the specification/logs directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistency of components naming in logs SDK

9 participants