Skip to content
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

Define how providers handle identical creation calls #4146

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ release.

### Traces

- Define how `TracerProvider` handles identical `Tracer` creation calls.
([#4146](https://github.com/open-telemetry/opentelemetry-specification/pull/4146))

### Metrics

- Define how `MeterProvider` handles identical `Meter` creation calls.
([#4146](https://github.com/open-telemetry/opentelemetry-specification/pull/4146))

### Logs

- Define how `LoggerProvider` handles identical `Logger` creation calls.
([#4146](https://github.com/open-telemetry/opentelemetry-specification/pull/4146))

### Events

### Resource
Expand Down
7 changes: 4 additions & 3 deletions specification/logs/bridge-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ The term *identical* applied to `Logger`s describes instances where all
identifying fields are equal. The term *distinct* applied to `Logger`s describes
instances where at least one identifying field has a different value.

The effect of associating a Schema URL with a `Logger` MUST be that the telemetry
emitted using the `Logger` will be associated with the Schema URL, provided that
the emitted data format is capable of representing such association.
The effect of associating a Schema URL and instrumentation scope attributes with
a `Logger` MUST be that the telemetry emitted using the `Logger` will be
associated with the Schema URL and instrumentation scope attributes, provided
that the emitted data format is capable of representing such association.

## Logger

Expand Down
5 changes: 5 additions & 0 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
is stored on the created `Logger`.

The method MUST return the same instance when the caller requests *identical*
`Logger`s. In such scenario, the returned `Logger` MUST have the non-identifying
fields' values (e.g. isntrumentation scope attributes) assigned during the first
*identical* `Logger` creation call.

In the case where an invalid `name` (null or empty string) is specified, a
working `Logger` 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 Down
10 changes: 8 additions & 2 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@ The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
is stored on the created `Meter`.

The method MUST return the same instance when the caller requests *identical*
`Meter`s. In such scenario, the returned `Meter` MUST have the non-identifying
fields' values (e.g. isntrumentation scope attributes) assigned during the first
*identical* `Meter` creation call.

In the case where an invalid `name` (null or empty string) is specified, a
working Meter MUST be returned as a fallback rather than returning null or
throwing an exception, its `name` SHOULD keep the original invalid value, and a
message reporting that the specified value is invalid SHOULD be logged.

When a Schema URL is passed as an argument when creating a `Meter` the emitted
telemetry for that `Meter` MUST be associated with the Schema URL, provided
When a Schema URL and instrumentation scope attributes are passed as an argument
when creating a `Meter` the emitted telemetry for that `Meter` MUST be
associated with the Schema URL and instrumentation scope attributes, provided
that the emitted data format is capable of representing such association.

**Status**: [Development](../document-status.md) - The `MeterProvider` MUST
Expand Down
8 changes: 4 additions & 4 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ the tracer could, for example, do a look-up with its identity in a map
in the `TracerProvider`, or the `TracerProvider` could maintain a registry of
all returned `Tracer`s and actively update their configuration if it changes.

The effect of associating a Schema URL with a `Tracer` MUST be that the
telemetry emitted using the `Tracer` will be associated with the Schema URL,
provided that the emitted data format is capable of representing such
association.
The effect of associating a Schema URL and instrumentation scope attributes with
a `Tracer` MUST be that the telemetry emitted using the `Tracer` will be
associated with the Schema URL and instrumentation scope attributes, provided
that the emitted data format is capable of representing such association.

## Context Interaction

Expand Down
5 changes: 5 additions & 0 deletions specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
is stored on the created `Tracer`.

The method MUST return the same instance when the caller requests *identical*
`Tracer`s. In such scenario, the returned `Tracer` MUST have the non-identifying
fields' values (e.g. isntrumentation scope attributes) assigned during the first
*identical* `Tracer` creation call.

**Status**: [Development](../document-status.md) - The `TracerProvider` MUST
compute the relevant [TracerConfig](#tracerconfig) using the
configured [TracerConfigurator](#tracerconfigurator), and create
Expand Down
Loading