Skip to content

Commit 074e0bb

Browse files
authored
Define file configuration parse and create operations (open-telemetry#3437)
Part of incorporating [OTEP open-telemetry#225](open-telemetry/oteps#225) into the specification. Followup to open-telemetry#3360.
1 parent fe43fbb commit 074e0bb

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ release.
2626

2727
### SDK Configuration
2828

29+
- Define file configuration parse and create operations.
30+
([#3437](https://github.com/open-telemetry/opentelemetry-specification/pull/3437))
31+
2932
### Common
3033

3134
### Supplementary Guidelines

specification/configuration/file-configuration.md

+49-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ linkTitle: File
1515
- [SDK Configuration](#sdk-configuration)
1616
* [In-Memory Configuration Model](#in-memory-configuration-model)
1717
* [Operations](#operations)
18+
+ [Parse](#parse)
19+
+ [Create](#create)
1820
- [References](#references)
1921

2022
<!-- tocstop -->
@@ -66,10 +68,54 @@ name `Configuration` is RECOMMENDED.
6668

6769
### Operations
6870

69-
TODO: define how to parse configuration file to configuration model
71+
SDK implementations of configuration MUST provide the following operations.
7072

71-
TODO: define how to apply configuration model to produce configured sdk
72-
components
73+
Note: Because these operations are stateless pure functions, they are not
74+
defined as part of any type, class, interface, etc. SDKs may organize them in
75+
whatever manner is idiomatic for the language.
76+
77+
TODO: Add operation to update SDK components with new configuration for usage
78+
with OpAmp
79+
80+
#### Parse
81+
82+
Parse and validate a [configuration file](#configuration-file).
83+
84+
**Parameters:**
85+
86+
* `file`: The [configuration file](#configuration-file) to parse. This MAY be a
87+
file path, or language specific file data structure, or a stream of a file's content.
88+
89+
**Returns:** [configuration model](#in-memory-configuration-model)
90+
91+
This SHOULD return an error if:
92+
93+
* The `file` doesn't exist or is invalid
94+
* The parsed `file` content does not conform to
95+
the [configuration model](#configuration-model) schema.
96+
97+
TODO: define behavior if some portion of configuration model is not supported
98+
99+
#### Create
100+
101+
Interpret [configuration model](#in-memory-configuration-model) and return SDK components.
102+
103+
**Parameters:**
104+
105+
* `configuration` - The configuration model.
106+
107+
**Returns:** Top level SDK components:
108+
109+
* `TracerProvider`
110+
* `MeterProvider`
111+
* `LoggerProvider`
112+
* `Propagators`
113+
114+
The multiple responses MAY be returned using a tuple, or some other data
115+
structure encapsulating the components.
116+
117+
This SHOULD return an error if it encounters an error in `configuration` (i.e.
118+
fail fast).
73119

74120
## References
75121

0 commit comments

Comments
 (0)