Skip to content

Commit

Permalink
Introduce Instrumentation Scope Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrannajaryan committed May 24, 2022
1 parent 2a272d2 commit 403d55d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ release.

### Common

- Introduce Instrumentation Scope Attributes
([#2579](https://github.com/open-telemetry/opentelemetry-specification/pull/2579))

## v1.11.0 (2022-05-04)

### Context
Expand Down
24 changes: 20 additions & 4 deletions specification/logs/logging-library-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,26 @@ Logging Library SDK contains the following components:

Methods:

- Get LogEmitter. Accepts the instrumentation scope name and version and returns
a LogEmitter associated with the instrumentation scope.
- Shutdown.
- ForceFlush.
#### Get LogEmitter

Accepts the following parameters: instrumentation scope name, optional version and
attributes. Returns a LogEmitter associated with the parameters.

The implementation MUST NOT return the same `LogEmitter` when called repeatedly with
different values of parameters. The only exception to this rule is no-op `LogEmitter`, the
implementation MAY return the same instance regardless of parameter values.

It is unspecified whether or under which conditions the same or different
`LogEmitter` instances are returned from this functions when the same
(name,version,attributes) parameters are used.

#### Shutdown

TBD

#### ForceFlush

TBD

LogEmitterProvider can be configured at startup time, to be associated with a
Resource and with LogProcessor/LogExporter pipeline.
Expand Down
20 changes: 14 additions & 6 deletions specification/metrics/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,21 @@ This API MUST accept the following parameters:
has a version (e.g. a library version). Example value: `1.0.0`.
* [since 1.4.0] `schema_url` (optional): Specifies the Schema URL that should be
recorded in the emitted telemetry.
* [since 1.12.0] `attributes` (optional): Specifies the instrumentation scope attributes
to associate with emitted telemetry.

Meters are identified by all of these fields. When more than one
Meter of the same `name`, `version`, and `schema_url` is created, it
is unspecified whether or under which conditions the same or different
`Meter` instances are returned. The term *identical* applied to
Meters describes instances where all identifying fields are equal.
The term *distinct* applied to Meters describes instances where at
Meters are identified by all of these parameters.

The implementation MUST NOT return the same `Meter` when called repeatedly with
different values of parameters. The only exception to this rule is no-op `Meter`, the
implementation MAY return the same instance regardless of parameter values.

It is unspecified whether or under which conditions the same or different
`Meter` instances are returned from this function when the same
(name,version,schema_url,attributes) parameters are used.

The term *identical* applied to Meters describes instances where all identifying fields
are equal. The term *distinct* applied to Meters describes instances where at
least one identifying field has a different value.

Implementations MUST NOT require users to repeatedly obtain a `Meter` with
Expand Down
9 changes: 8 additions & 1 deletion specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,16 @@ This API MUST accept the following parameters:
has a version (e.g. a library version). Example value: `1.0.0`.
- [since 1.4.0] `schema_url` (optional): Specifies the Schema URL that should be
recorded in the emitted telemetry.
- [since 1.12.0] `attributes` (optional): Specifies the instrumentation scope attributes
to associate with emitted telemetry.

The implementation MUST NOT return the same `Tracer` when called repeatedly with
different values of parameters. The only exception to this rule is no-op `Tracer`, the
implementation MAY return the same instance regardless of parameter values.

It is unspecified whether or under which conditions the same or different
`Tracer` instances are returned from this functions.
`Tracer` instances are returned from this function when the same
(name,version,schema_url,attributes) parameters are used.

Implementations MUST NOT require users to repeatedly obtain a `Tracer` again
with the same name+version+schema_url to pick up configuration changes.
Expand Down
9 changes: 9 additions & 0 deletions specification/trace/sdk_exporters/non-otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,12 @@ OpenTelemetry Span's dropped links count MUST be reported as a key-value pair
associated with the Span. The key name MUST be `otel.dropped_links_count`.

This key-value pair should only be recorded when it contains a non-zero value.

### Instrumentation Scope Attributes

Exporters to formats that don't have a concept that is equivalent to the Scope
will record the attributes at the most suitable place in their corresponding format,
typically at the Span, Metric or LogRecord equivalent.

If the same attribute is specified both at the Span/Metric/LogRecord and at the Scope
then the attribute value at Span/Metric/LogRecord takes precedence.

0 comments on commit 403d55d

Please sign in to comment.