Skip to content

Commit

Permalink
simplified shutdown and forceflush sections
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkuba committed May 3, 2024
1 parent 5d3a8a1 commit 2b27f30
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions specification/logs/event-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ From OpenTelemetry's perspective LogRecords and Events are both represented
using the same [data model](./event-api.md#data-model). Therefore, the default
implementation of an Event SDK MUST generate events using the [Logs Data Model](./data-model.md).

The SDK MUST use the default [Logs SDK](./sdk.md) to generate, process and export `LogRecord`s.
The SDK MUST use the [Logs SDK](./sdk.md) to generate, process and export `LogRecord`s.

## EventLoggerProvider

Expand All @@ -51,10 +51,6 @@ It SHOULD only be possible to create `EventLogger` instances through a `EventLog

The `EventLoggerProvider` MUST implement the [Get an EventLogger API](event-api.md#get-an-eventlogger).

The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
is associated with `Event`s emitted by the created `EventLogger`.

In the case where an invalid `name` (null or empty string) is specified, a
working `EventLogger` MUST be returned as a fallback rather than returning null or
throwing an exception. Its `name` SHOULD keep the original invalid value, and a
Expand All @@ -69,18 +65,6 @@ related to processing MUST be done by configuring the `LoggerProvider` directly.

This method provides a way for provider to do any cleanup required.

`Shutdown` MUST be called only once for each `EventLoggerProvider` instance. After
the call to `Shutdown`, subsequent attempts to get an `EventLogger` are not allowed.
SDKs SHOULD return a valid no-op `EventLogger` for these calls, if possible.

`Shutdown` SHOULD provide a way to let the caller know whether it succeeded,
failed or timed out.

`Shutdown` SHOULD complete or abort within some timeout. `Shutdown` MAY be
implemented as a blocking API or an asynchronous API which notifies the caller
via a callback or an event. [OpenTelemetry SDK](../overview.md#sdk) authors MAY
decide if they want to make the shutdown timeout configurable.

`Shutdown` MUST be implemented at least by invoking `Shutdown` on the delegate
`LoggerProvider`, which in effect invokes `Shutdown` on all registered
registered [LogRecordProcessors](#logrecordprocessor).
Expand All @@ -91,21 +75,6 @@ This method provides a way for the provider to notify the delegate `LoggerProvid
to force all registered [LogRecordProcessors](#logrecordprocessor) to immediately export all
`LogRecords` that have not yet been exported.

`ForceFlush` SHOULD provide a way to let the caller know whether it succeeded,
failed or timed out. `ForceFlush` SHOULD return some **ERROR** status if there
is an error condition; and if there is no error condition, it SHOULD return
some **NO ERROR** status, language implementations MAY decide how to model
**ERROR** and **NO ERROR**.

`ForceFlush` SHOULD complete or abort within some timeout. `ForceFlush` MAY be
implemented as a blocking API or an asynchronous API which notifies the caller
via a callback or an event. [OpenTelemetry SDK](../overview.md#sdk) authors MAY
decide if they want to make the flush timeout configurable.

`ForceFlush` MUST invoke `ForceFlush` on all
[LogRecordProcessors](#logrecordprocessor) that are registered with the delegate
`LoggerProvider`.

## EventLogger

### Emit Event
Expand Down

0 comments on commit 2b27f30

Please sign in to comment.