Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f45655b
Have InstrumentationScope use normative language.
carlosalberto Apr 25, 2025
c1a4920
Fix typos.
carlosalberto Apr 26, 2025
c84fa83
More typos.
carlosalberto Apr 28, 2025
484313b
Merge branch 'main' into normative-instr-scope
carlosalberto Apr 29, 2025
ce07b85
Update specification/common/README.md
carlosalberto May 1, 2025
51610fd
Move instrumentation-scope to its own file.
carlosalberto May 3, 2025
ff6d662
Add examples section.
carlosalberto May 3, 2025
b2fd801
Fix typo.
carlosalberto May 3, 2025
78e3911
Feedback.
carlosalberto May 5, 2025
caa53d0
More feedback.
carlosalberto May 7, 2025
5872000
More feedback.
carlosalberto May 7, 2025
333bcbe
Update specification/common/instrumentation-scope.md
carlosalberto May 13, 2025
23db5e8
Instrumentation instead of Instrumented.
carlosalberto May 13, 2025
74d2194
Merge branch 'main' into normative-instr-scope
carlosalberto May 14, 2025
b2b4e2d
Add a CHANGELOG entry.
carlosalberto May 14, 2025
ccc4e75
Update CHANGELOG.md
carlosalberto May 15, 2025
abcb1c7
Fix broken link.
carlosalberto May 16, 2025
158d2d2
Update specification/common/instrumentation-scope.md
carlosalberto May 19, 2025
3ebe059
Update specification/common/instrumentation-scope.md
carlosalberto May 20, 2025
c071ba2
Relax restrictions to allow implementations to be updated.
carlosalberto May 23, 2025
5c71c39
More feedback.
carlosalberto May 23, 2025
c2b2ba9
Relax the name requirement to match what we have in other parts.
carlosalberto May 29, 2025
d07707c
Merge branch 'main' into normative-instr-scope
carlosalberto Jun 5, 2025
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ release.

### Common

- Have InstrumentationScope use normative language.
Comment thread
carlosalberto marked this conversation as resolved.
Outdated
([#4488](https://github.com/open-telemetry/opentelemetry-specification/pull/4488))

### Supplementary Guidelines

### OTEPs
Expand Down
2 changes: 1 addition & 1 deletion specification/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ at this time, as discussed in
## Attribute Collections

[Resources](../resource/sdk.md),
[Instrumentation Scopes](../glossary.md#instrumentation-scope),
[Instrumentation Scopes](#instrumentation-scope),
[Metric points](../metrics/data-model.md#metric-points),
[Spans](../trace/api.md#set-attributes), Span
[Events](../trace/api.md#add-events), Span
Expand Down
52 changes: 52 additions & 0 deletions specification/common/instrumentation-scope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Instrumentation Scope
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.

Don't include a linkTitle if it is the same as the time.

--->

# Instrumentation Scope

**Status**: [Stable](../document-status.md)

A logical unit of software, with which the emitted telemetry can be
Comment thread
carlosalberto marked this conversation as resolved.
Outdated
associated. It is typically the developer's choice to decide what denotes a
reasonable instrumentation scope. The most common approach is to use
the name and version of the [instrumentation library](../glossary.md#instrumentation-library),
with any additional identifying information as part of the scope's attributes.
Other software components can be used too to get name, version and additional attributes, e.g.
a module, a package, a class or a plugin.

The instrumentation scope is defined by the
(name,version,schema_url,attributes) tuple where version, schema_url, and
Comment thread
pellared marked this conversation as resolved.
attributes are optional. This tuple MUST uniquely identify the logical unit of
Comment thread
carlosalberto marked this conversation as resolved.
Outdated
software that emits the telemetry. A typical approach to ensure uniqueness is to
use the fully qualified name of the emitting software unit (e.g. fully qualified library
name or fully qualified class name).

The instrumentation scope MUST be used to obtain a
[Tracer, Meter, or Logger](../glossary.md#tracer-name--meter-name--logger-name).
Comment thread
carlosalberto marked this conversation as resolved.
Outdated

The instrumentation scope's name MUST be specified to identify the `InstrumentationScope`
Comment thread
carlosalberto marked this conversation as resolved.
Outdated
name. It SHOULD be set to the empty string as last fallback.

The instrumentation scope's optional Schema URL MUST identify the [Telemetry
Comment thread
carlosalberto marked this conversation as resolved.
Outdated
Schema](../schemas/README.md) that the instrumentation's emitted
telemetry conforms to.

The instrumentation scope's optional attributes provide additional information about
Comment thread
mx-psi marked this conversation as resolved.
the scope. For example for a scope that specifies an
Comment thread
carlosalberto marked this conversation as resolved.
instrumentation library an additional attribute may be recorded to denote the URL of the
repository URL the library's source code is stored.

## Examples

Here is a non comprehensive list of usage scenarios:

* Generic instrumentation library with its name, version and attributes containing
additional library information.
* Database access instrumented with its own name and version (e.g. `db.system.name`).
Comment thread
carlosalberto marked this conversation as resolved.
This can be leveraged by APIs abstracting access to different underlying databases,
such as JDBC or SqlAlchemy.
* Client consuming or producing information, using its name, version and `id` to set
`InstrumentationScope`.
* Internal application components emitting their own telemetry, relying on
`InstrumentationScope` attributes to differentiate themselves in case multiple
instances of the same type exist.
32 changes: 1 addition & 31 deletions specification/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Some other fundamental terms are documented in the [overview document](overview.
* [Exporter Library](#exporter-library)
* [Instrumented Library](#instrumented-library)
* [Instrumentation Library](#instrumentation-library)
* [Instrumentation Scope](#instrumentation-scope)
* [Tracer Name / Meter Name / Logger Name](#tracer-name--meter-name--logger-name)
* [Execution Unit](#execution-unit)
- [Logs](#logs)
Expand Down Expand Up @@ -163,42 +162,13 @@ Example: `io.opentelemetry.contrib.mongodb`.

Synonyms: *Instrumenting Library*.

### Instrumentation Scope

A logical unit of the application code with which the emitted telemetry can be
associated. It is typically the developer's choice to decide what denotes a
reasonable instrumentation scope. The most common approach is to use the
[instrumentation library](#instrumentation-library) as the scope, however other
scopes are also common, e.g. a module, a package, or a class can be chosen as
the instrumentation scope.

The instrumentation scope is defined by the
(name,version,schema_url,attributes) tuple where version, schema_url, and
attributes are optional. This tuple uniquely identifies the logical unit of the
code that emits the telemetry. A typical approach to ensure uniqueness is to
use the fully qualified name of the emitting code (e.g. fully qualified library
name or fully qualified class name).

The instrumentation scope is used to obtain a
[Tracer, Meter, or Logger](#tracer-name--meter-name--logger-name).

The instrumentation scope's optional Schema URL identifies the [Telemetry
Schema](schemas/README.md) that the instrumentation's emitted
telemetry conforms to.

The instrumentation scope may have zero or more additional attributes that provide
additional information about the scope. For example for a scope that specifies an
instrumentation library an additional attribute may be recorded to denote the URL of the
repository URL the library's source code is stored. Since the scope is a build-time
concept the attributes of the scope cannot change at runtime.

### Tracer Name / Meter Name / Logger Name

This refers to the `name` and (optional) `version` arguments specified when
creating a new `Tracer` or `Meter` (see
[Obtaining a Tracer](trace/api.md#tracerprovider)/[Obtaining a Meter](metrics/api.md#meterprovider))/[Obtaining a Logger](logs/api.md#loggerprovider).
The name/version pair identifies the
[Instrumentation Scope](#instrumentation-scope), for example the
[Instrumentation Scope](common/instrumentation-scope.md), for example the
[Instrumentation Library](#instrumentation-library) or another unit of
application in the scope of which the telemetry is emitted.

Expand Down
2 changes: 1 addition & 1 deletion specification/logs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The `LoggerProvider` MUST provide the following functions:
This API MUST accept the following [instrumentation scope](data-model.md#field-instrumentationscope)
parameters:

* `name`: Specifies the name of the [instrumentation scope](../glossary.md#instrumentation-scope),
* `name`: Specifies the name of the [instrumentation scope](../common/instrumentation-scope.md),
such as the [instrumentation library](../glossary.md#instrumentation-library)
(e.g. `io.opentelemetry.contrib.mongodb`), package, module or class name.
If an application or library has built-in OpenTelemetry instrumentation, both
Expand Down
4 changes: 2 additions & 2 deletions specification/logs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ This field is optional.

### Field: `InstrumentationScope`

Type: [Instrumentation Scope](../glossary.md#instrumentation-scope).
Type: [Instrumentation Scope](../common/instrumentation-scope.md).

Description: the [instrumentation scope](../glossary.md#instrumentation-scope).
Description: the [instrumentation scope](../common/instrumentation-scope.md).
Multiple occurrences of events coming from the same scope can happen across time and
they all have the same value of `InstrumentationScope`. This field is optional.

Expand Down
4 changes: 2 additions & 2 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ It SHOULD only be possible to create `Logger` instances through a `LoggerProvide
The `LoggerProvider` MUST implement the [Get a Logger API](api.md#get-a-logger).

The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
an [`InstrumentationScope`](../common/instrumentation-scope.md) instance which
is stored on the created `Logger`.

In the case where an invalid `name` (null or empty string) is specified, a
Expand Down Expand Up @@ -104,7 +104,7 @@ the [LoggerConfig](#loggerconfig) for a [Logger](#logger).
The function MUST accept the following parameter:

* `logger_scope`:
The [`InstrumentationScope`](../glossary.md#instrumentation-scope) of
The [`InstrumentationScope`](../common/instrumentation-scope.md) of
the `Logger`.

The function MUST return the relevant `LoggerConfig`, or some signal indicating
Expand Down
2 changes: 1 addition & 1 deletion specification/logs/supplementary-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ popular logging library.
### Logger Name

If the logging library has a concept that is similar to OpenTelemetry's
definition of the [Instrumentation Scope's](../glossary.md#instrumentation-scope)
definition of the [Instrumentation Scope's](../common/instrumentation-scope.md)
name, then the appender's implementation should use that value as the
name parameter when [obtaining the Logger](./api.md#get-a-logger).

Expand Down
2 changes: 1 addition & 1 deletion specification/metrics/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The `MeterProvider` MUST provide the following functions:
This API MUST accept the following parameters:

* `name`: Specifies the name of the [instrumentation
scope](../glossary.md#instrumentation-scope), such as the
scope](../common/instrumentation-scope.md), such as the
[instrumentation library](../glossary.md#instrumentation-library) (e.g.
`io.opentelemetry.contrib.mongodb`), package,
module or class name. If an application or library has built-in OpenTelemetry
Expand Down
6 changes: 3 additions & 3 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ It SHOULD only be possible to create `Meter` instances through a `MeterProvider`
The `MeterProvider` MUST implement the [Get a Meter API](api.md#get-a-meter).

The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
an [`InstrumentationScope`](../common/instrumentation-scope.md) instance which
is stored on the created `Meter`.

In the case where an invalid `name` (null or empty string) is specified, a
Expand Down Expand Up @@ -161,7 +161,7 @@ the [MeterConfig](#meterconfig) for a [Meter](#meter).
The function MUST accept the following parameter:

* `meter_scope`:
The [`InstrumentationScope`](../glossary.md#instrumentation-scope) of
The [`InstrumentationScope`](../common/instrumentation-scope.md) of
the `Meter`.

The function MUST return the relevant `MeterConfig`, or some signal indicating
Expand Down Expand Up @@ -1717,7 +1717,7 @@ MAY return successfully collected results and a failed reasons list to the
caller.

If a batch of [Metric Points](./data-model.md#metric-points) can include
[`InstrumentationScope`](../glossary.md#instrumentation-scope) information,
[`InstrumentationScope`](../common/instrumentation-scope.md) information,
`Produce` SHOULD include a single InstrumentationScope which identifies the
`MetricProducer`.

Expand Down
2 changes: 1 addition & 1 deletion specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The `TracerProvider` MUST provide the following functions:
This API MUST accept the following parameters:

- `name` (required): This name SHOULD uniquely identify the
[instrumentation scope](../glossary.md#instrumentation-scope), such as the
[instrumentation scope](../common/instrumentation-scope.md), such as the
[instrumentation library](../glossary.md#instrumentation-library) (e.g.
`io.opentelemetry.contrib.mongodb`), package, module or class name. If an
application or library has built-in OpenTelemetry instrumentation, both
Expand Down
4 changes: 2 additions & 2 deletions specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ It SHOULD only be possible to create `Tracer` instances through a `TracerProvide
The `TracerProvider` MUST implement the [Get a Tracer API](api.md#get-a-tracer).

The input provided by the user MUST be used to create
an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which
an [`InstrumentationScope`](../common/instrumentation-scope.md) instance which
is stored on the created `Tracer`.

**Status**: [Development](../document-status.md) - The `TracerProvider` MUST
Expand Down Expand Up @@ -117,7 +117,7 @@ the [TracerConfig](#tracerconfig) for a [Tracer](#tracer).
The function MUST accept the following parameter:

* `tracer_scope`:
The [`InstrumentationScope`](../glossary.md#instrumentation-scope) of
The [`InstrumentationScope`](../common/instrumentation-scope.md) of
the `Tracer`.

The function MUST return the relevant `TracerConfig`, or some signal indicating
Expand Down
Loading