Skip to content

Commit

Permalink
Define file configuration parse and create operations (#3437)
Browse files Browse the repository at this point in the history
Part of incorporating [OTEP
#225](open-telemetry/oteps#225) into the
specification.

Followup to #3360.
  • Loading branch information
jack-berg authored Oct 16, 2023
1 parent eda62e4 commit 541b2ff
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ release.

### SDK Configuration

- Define file configuration parse and create operations.
([#3437](https://github.com/open-telemetry/opentelemetry-specification/pull/3437))

### Common

### Supplementary Guidelines
Expand Down
52 changes: 49 additions & 3 deletions specification/configuration/file-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ linkTitle: File
- [SDK Configuration](#sdk-configuration)
* [In-Memory Configuration Model](#in-memory-configuration-model)
* [Operations](#operations)
+ [Parse](#parse)
+ [Create](#create)
- [References](#references)

<!-- tocstop -->
Expand Down Expand Up @@ -66,10 +68,54 @@ name `Configuration` is RECOMMENDED.

### Operations

TODO: define how to parse configuration file to configuration model
SDK implementations of configuration MUST provide the following operations.

TODO: define how to apply configuration model to produce configured sdk
components
Note: Because these operations are stateless pure functions, they are not
defined as part of any type, class, interface, etc. SDKs may organize them in
whatever manner is idiomatic for the language.

TODO: Add operation to update SDK components with new configuration for usage
with OpAmp

#### Parse

Parse and validate a [configuration file](#configuration-file).

**Parameters:**

* `file`: The [configuration file](#configuration-file) to parse. This MAY be a
file path, or language specific file data structure, or a stream of a file's content.

**Returns:** [configuration model](#in-memory-configuration-model)

This SHOULD return an error if:

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

TODO: define behavior if some portion of configuration model is not supported

#### Create

Interpret [configuration model](#in-memory-configuration-model) and return SDK components.

**Parameters:**

* `configuration` - The configuration model.

**Returns:** Top level SDK components:

* `TracerProvider`
* `MeterProvider`
* `LoggerProvider`
* `Propagators`

The multiple responses MAY be returned using a tuple, or some other data
structure encapsulating the components.

This SHOULD return an error if it encounters an error in `configuration` (i.e.
fail fast).

## References

Expand Down

0 comments on commit 541b2ff

Please sign in to comment.