diff --git a/CHANGELOG.md b/CHANGELOG.md index f54b01b01f1..837b1d72d2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ release. ### SDK Configuration +- Declarative configuration: add `Get distribution config` operation to the `Config Provider` specification. + ([#4770](https://github.com/open-telemetry/opentelemetry-specification/issues/4770)) - Declarative configuration: clarify default behavior and validation requirements of `create` and `parse`. ([#4780](https://github.com/open-telemetry/opentelemetry-specification/pull/4780)) diff --git a/specification/configuration/api.md b/specification/configuration/api.md index e076c95e434..ff51534eb05 100644 --- a/specification/configuration/api.md +++ b/specification/configuration/api.md @@ -13,6 +13,7 @@ weight: 1 * [ConfigProvider](#configprovider) + [ConfigProvider operations](#configprovider-operations) - [Get instrumentation config](#get-instrumentation-config) + - [Get distribution config](#get-distribution-config) * [ConfigProperties](#configproperties) @@ -36,12 +37,12 @@ It consists of the following main components: ### ConfigProvider `ConfigProvider` provides access to configuration properties relevant to -instrumentation. +instrumentation and distribution. -Instrumentation libraries access `ConfigProvider` during -initialization. `ConfigProvider` may be passed as an argument to the -instrumentation library, or the instrumentation library may access it from a -central place. Thus, the API SHOULD provide a way to access a global +Instrumentation libraries and vendor's custom code can access `ConfigProvider` during +and after initialization. `ConfigProvider` may be passed as an argument, or may be accessed from a +central place. +Thus, the API SHOULD provide a way to access a global default `ConfigProvider`, and set/register it. #### ConfigProvider operations @@ -49,6 +50,7 @@ default `ConfigProvider`, and set/register it. The `ConfigProvider` MUST provide the following functions: * [Get instrumentation config](#get-instrumentation-config) +* [Get distribution config](#get-distribution-config) TODO: decide if additional operations are needed to improve API ergonomics @@ -64,6 +66,18 @@ If the `.instrumentation` node is not set, get instrumentation config MUST return nil, null, undefined or another language-specific idiomatic pattern denoting empty. +##### Get distribution config + +Obtain configuration relevant to a distribution. + +**Returns:** [`ConfigProperties`](#configproperties) representing +the [`.distribution`](https://github.com/open-telemetry/opentelemetry-configuration/blob/670901762dd5cce1eecee423b8660e69f71ef4be/examples/kitchen-sink.yaml#L438-L439) +configuration mapping node. + +If the `.distribution` node is not set, get distribution config MUST +return nil, null, undefined or another language-specific idiomatic pattern +denoting empty. + ### ConfigProperties `ConfigProperties` is a programmatic representation of a configuration mapping diff --git a/specification/configuration/sdk.md b/specification/configuration/sdk.md index 296cbd13810..b2dc470fa7d 100644 --- a/specification/configuration/sdk.md +++ b/specification/configuration/sdk.md @@ -64,8 +64,9 @@ the name `Configuration` is RECOMMENDED. The SDK implementation of [`ConfigProvider`](./api.md#configprovider) MUST be created using a [`ConfigProperties`](./api.md#configproperties) representing -the [`.instrumentation`](https://github.com/open-telemetry/opentelemetry-configuration/blob/670901762dd5cce1eecee423b8660e69f71ef4be/examples/kitchen-sink.yaml#L438-L439) -mapping node of the [configuration model](./data-model.md). +the [`.instrumentation`](https://github.com/open-telemetry/opentelemetry-configuration/blob/41518147ca741d6ce811f143ce463630147c9986/examples/kitchen-sink.yaml#L378-L433) +and [`.distribution`](https://github.com/open-telemetry/opentelemetry-configuration/blob/41518147ca741d6ce811f143ce463630147c9986/examples/kitchen-sink.yaml#L434-L436) +mapping nodes of the [configuration model](./data-model.md). ### SDK extension components