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 file configuration parse and create operations #3437

Merged
merged 24 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
68868a8
Define file configuration parse and configure operations
jack-berg Apr 24, 2023
5e5cb37
Add changelog entry
jack-berg Apr 24, 2023
648d9eb
Merge branch 'main' into parse-and-configure
jack-berg Apr 26, 2023
eeee405
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg May 2, 2023
53003fa
Rename Configurer to ConfigurationProvider
jack-berg May 2, 2023
f71a591
Merge branch 'parse-and-configure' of https://github.com/jack-berg/op…
jack-berg May 2, 2023
b58b4aa
Fix broken link
jack-berg May 2, 2023
87ef455
Merge branch 'main' into parse-and-configure
jack-berg May 5, 2023
5d715dd
PR feedback
jack-berg May 12, 2023
b530ee7
Merge branch 'parse-and-configure' of https://github.com/jack-berg/op…
jack-berg May 12, 2023
181f8fa
Merge branch 'main' into parse-and-configure
jack-berg May 12, 2023
a72e497
Rename to ConfigurationInterpreter
jack-berg May 17, 2023
f8a20c6
Merge branch 'parse-and-configure' of https://github.com/jack-berg/op…
jack-berg May 17, 2023
d5b9675
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg Sep 18, 2023
2f880d1
Rename to ConfigurationFactory
jack-berg Sep 18, 2023
0b402e2
remove API
jack-berg Sep 18, 2023
488784f
Rename to Configurator
jack-berg Sep 19, 2023
aabc0cc
fix typo
jack-berg Oct 4, 2023
8e861b2
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg Oct 4, 2023
a475548
Remove configurator, describing operations as pure functions
jack-berg Oct 11, 2023
2719093
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg Oct 11, 2023
5298301
Merge branch 'main' into parse-and-configure
jack-berg Oct 13, 2023
ec34b1e
Fix changelog
jack-berg Oct 13, 2023
721cee7
Merge branch 'parse-and-configure' of https://github.com/jack-berg/op…
jack-berg Oct 13, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ release.
- Move `sdk-configuration.md` and `sdk-environment-variables.md`
to `/specification/configuration/`.
([#3434](https://github.com/open-telemetry/opentelemetry-specification/pull/3434))
- Define file configuration parse and configure operations.
([#3437](https://github.com/open-telemetry/opentelemetry-specification/pull/3437))

### Telemetry Schemas

Expand Down
52 changes: 47 additions & 5 deletions specification/configuration/file-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
- [Configuration file](#configuration-file)
- [SDK Configuration](#sdk-configuration)
* [In-Memory Configuration Model](#in-memory-configuration-model)
* [Operations](#operations)
+ [Parse File to Configuration](#parse-file-to-configuration)
* [Configurer](#configurer)
+ [Create Configurer](#create-configurer)
+ [Get TracerProvider, MeterProvider, LoggerProvider](#get-tracerprovider-meterprovider-loggerprovider)
- [References](#references)

<!-- tocstop -->
Expand Down Expand Up @@ -60,12 +63,51 @@ to provide this in-memory representation in a manner that is idiomatic for their
language. If an SDK needs to expose a class or interface, the
name `Configuration` is RECOMMENDED.

### Operations
#### Parse File to Configuration

TODO: define how to parse configuration file to configuration model
SDKs MUST provide an API to parse and validate
a [configuration file](#configuration-file) and return a
corresponding [Configuration Model](#in-memory-configuration-model).

TODO: define how to apply configuration model to produce configured sdk
components
The API MUST accept the following parameters:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

* `file`: The [configuration file](#configuration-file) to parse. This MAY be a
file path, or language specific file class, or a stream of a file's contents.
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

The API MAY return an error if:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

* The `file` doesn't exist or is invalid
* The parsed `file` contents do not conform to
the [configuration model](#configuration-model) schema.

### Configurer
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

`Configurer` is a class responsible for
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
interpreting [Configuration](#in-memory-configuration-model) and producing
configured SDK components.

It MUST be possible to [create](#create-configurer) multiple `Configurer`s with
different configurations. It is the caller's responsibility to ensure the
resulting [SDK components](#get-tracerprovider-meterprovider-loggerprovider) are
correctly wired into the application and instrumentation.

#### Create Configurer

Create a `Configurer` from a configuration model.

The API MUST accept the following parameters:

* `configuration` - The [configuration model](#in-memory-configuration-model).
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

#### Get TracerProvider, MeterProvider, LoggerProvider

Interpret `configuration` and return SDK components (`TracerProvider`,
`MeterProvider`, `LoggerProvider`). The SDK components MUST strictly reflect
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
the `Configuration` and ignore
the [environment variable configuration scheme](../sdk-environment-variables.md).

// TODO: Extend Configurer with ability to update SDK components with new
// configuration for usage with OpAmp

## References

Expand Down