You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/configuration/sdk.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,9 @@ Parse SHOULD return an error if:
239
239
240
240
* The `file` doesn't exist or is invalid
241
241
* The parsed `file` content does not conform to
242
-
the [configuration model](data-model.md) schema.
242
+
the [configuration model](data-model.md) schema. Note that this includes
243
+
enforcing all constraints encoded into the schema (e.g. required properties
244
+
are present, that properties adhere to specified types, etc.).
243
245
244
246
#### Create
245
247
@@ -260,15 +262,31 @@ Interpret configuration model and return SDK components.
260
262
The multiple responses MAY be returned using a tuple, or some other data
261
263
structure encapsulating the components.
262
264
263
-
If a property has a default value defined (i.e. is _not_ required) and is
264
-
missing or present but null, Create MUST ensure the SDK component is configured
265
-
with the default value. If a property is required and is missing or present but
266
-
null, Create SHOULD return an error. For example, if configuring
267
-
the [span batching processor](../trace/sdk.md#batching-processor) and
268
-
the `scheduleDelayMillis` property is missing or present but null, the component
269
-
is configured with the default value of `5000`. However, if the `exporter`
270
-
property is missing or present but null, Create fails fast since there is no
271
-
default value for `exporter`.
265
+
Create requirements around default and null behavior are described below. Note that
266
+
[`defaultBehavior` and `nullBehavior`](https://github.com/open-telemetry/opentelemetry-configuration/blob/main/CONTRIBUTING.md#json-schema-source-and-output)
267
+
are defined in the configuration data model.
268
+
269
+
* If a property is present and the value is null, Create MUST use the
270
+
`nullBehavior`, or `defaultBehavior` if `nullBehavior` is not set.
271
+
* If a property is required, and not present, Create MUST return an error.
272
+
273
+
A few examples to illustrate:
274
+
275
+
* If configuring [`BatchSpanProcessor`](https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema-docs.md#batchspanprocessor-)
276
+
and `schedule_delay` is not present or present but null, the component is
277
+
configured according to the `defaultBehavior` of `5000`.
278
+
* If configuring [`SpanExporter`](https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema-docs.md#spanexporter)
279
+
and `console` is present and null, the component is configured with a
280
+
`console`exporter with default configuration since `console` is nullable.
281
+
282
+
The [configuration model](data-model.md) uses the JSON schema
0 commit comments