File configuration provides a mechanism for configuring OpenTelemetry which is more expressive and full-featured than the environment variable based scheme, and language agnostic in a way not possible with programmatic configuration.
File configuration defines a Configuration Model, which can be expressed in a configuration file. Configuration files can be validated against the Configuration Schema, and interpreted to produce configured OpenTelemetry components.
TODO: define stability guarantees and backwards compatibility
A configuration file is a file representation of the Configuration Model.
TODO: define acceptable file formats
TODO: define environment variable substitution
SDK configuration defines the interfaces and operations that SDKs are expected to expose to enable file based configuration.
In-Memory Configuration Model
SDKs SHOULD provide an in-memory representation of
the Configuration Model. In general, SDKs are encouraged
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
Configuration is RECOMMENDED.
SDK implementations of configuration MUST provide the following operations.
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 and validate a configuration file.
file: The 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
This SHOULD return an error if:
filedoesn’t exist or is invalid
- The parsed
filecontent does not conform to the configuration model schema.
TODO: define behavior if some portion of configuration model is not supported
Interpret configuration model and return SDK components.
configuration- The configuration model.
Returns: Top level SDK components:
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 proposal (OTEP #225)