From 5901c776679227bbf3291a68291bf8a460d7fc88 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:39:16 -0600 Subject: [PATCH 1/4] Change various usages of minimum to exclusiveMinimum (#151) * Change various usages of minimum to exclusiveMinimum * Update to reflect spec * Restructure descriptions to add line breaks and improve readibility --- examples/kitchen-sink.yaml | 194 +++++++++++++++++++---------- examples/sdk-config.yaml | 113 +++++++++++------ examples/sdk-migration-config.yaml | 113 +++++++++++------ schema/logger_provider.json | 4 +- schema/tracer_provider.json | 4 +- schema/type_descriptions.yaml | 134 ++++++++++++++------ 6 files changed, 379 insertions(+), 183 deletions(-) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index e0100dc..a3228b4 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -14,10 +14,12 @@ file_format: "0.3" disabled: false # Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits. attribute_limits: - # Configure max attribute value size. + # Configure max attribute value size. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. + # Configure max attribute count. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 # Configure logger provider. @@ -27,16 +29,18 @@ logger_provider: processors: - # Configure a batch log record processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 1000 is used. schedule_delay: 5000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: 512 # Configure exporter. @@ -44,13 +48,16 @@ logger_provider: # Configure exporter to be OTLP with HTTP transport. otlp_http: endpoint: http://localhost:4318/v1/logs - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -62,13 +69,16 @@ logger_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. Values include: protobuf, json. Implementations may not support json. + # Configure the encoding used for messages. + # Values include: protobuf, json. Implementations may not support json. # If omitted or null, protobuf is used. encoding: protobuf - # Configure a batch log record processor. @@ -80,13 +90,16 @@ logger_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -98,13 +111,16 @@ logger_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. # If omitted or null, false is used. insecure: false - # Configure a simple log record processor. @@ -115,10 +131,12 @@ logger_provider: console: # Configure log record limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 # Configure meter provider. @@ -169,10 +187,12 @@ meter_provider: opencensus: - # Configure a periodic metric reader. periodic: - # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Value must be non-negative. # If omitted or null, 60000 is used. interval: 60000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. timeout: 30000 # Configure exporter. @@ -182,13 +202,16 @@ meter_provider: # Configure endpoint, including the metric specific path. # If omitted or null, http://localhost:4318/v1/metrics is used. endpoint: http://localhost:4318/v1/metrics - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -200,19 +223,24 @@ meter_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. Values include: protobuf, json. Implementations may not support json. + # Configure the encoding used for messages. + # Values include: protobuf, json. Implementations may not support json. # If omitted or null, protobuf is used. encoding: protobuf - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure temporality preference. + # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure default histogram aggregation. + # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram # Configure metric producers. @@ -228,13 +256,16 @@ meter_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -246,19 +277,24 @@ meter_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. # If omitted or null, false is used. insecure: false - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure temporality preference. + # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure default histogram aggregation. + # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram - # Configure a periodic metric reader. @@ -267,9 +303,11 @@ meter_provider: exporter: # Configure exporter to be console. console: - # Configure views. Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). + # Configure views. + # Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). views: - - # Configure view selector. Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. + - # Configure view selector. + # Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. selector: # Configure instrument name selection criteria. # If omitted or null, all instrument names match. @@ -297,7 +335,8 @@ meter_provider: # Configure metric description of the resulting stream(s). # If omitted or null, the instrument's origin description is used. description: new_description - # Configure aggregation of the resulting stream(s). Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#aggregation. + # Configure aggregation of the resulting stream(s). + # Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#aggregation. # If omitted, default is used. aggregation: # Configure aggregation to be explicit_bucket_histogram. @@ -336,13 +375,15 @@ meter_provider: # If omitted, .attribute_keys.included are included. excluded: - key3 - # Configure the exemplar filter. Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. + # Configure the exemplar filter. + # Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. # If omitted or null, trace_based is used. exemplar_filter: trace_based # Configure text map context propagators. # If omitted, tracecontext and baggage are used. propagator: - # Configure the set of propagators to include in the composite text map propagator. Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. + # Configure the set of propagators to include in the composite text map propagator. + # Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. composite: [ tracecontext, baggage, b3, b3multi, jaeger, xray, ottrace ] # Configure tracer provider. # If omitted, a noop tracer provider is used. @@ -351,16 +392,18 @@ tracer_provider: processors: - # Configure a batch span processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 5000 is used. schedule_delay: 5000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: 512 # Configure exporter. @@ -370,13 +413,16 @@ tracer_provider: # Configure endpoint, including the trace specific path. # If omitted or null, http://localhost:4318/v1/traces is used. endpoint: http://localhost:4318/v1/traces - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -388,13 +434,16 @@ tracer_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. Values include: protobuf, json. Implementations may not support json. + # Configure the encoding used for messages. + # Values include: protobuf, json. Implementations may not support json. # If omitted or null, protobuf is used. encoding: protobuf - # Configure a batch span processor. @@ -406,13 +455,16 @@ tracer_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: /app/cert.pem - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: /app/cert.pem - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: /app/cert.pem # Configure headers. Entries have higher priority than entries from .headers_list. @@ -424,13 +476,16 @@ tracer_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. # If omitted or null, false is used. insecure: false - # Configure a batch span processor. @@ -442,7 +497,8 @@ tracer_provider: # Configure endpoint. # If omitted or null, http://localhost:9411/api/v2/spans is used. endpoint: http://localhost:9411/api/v2/spans - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates indefinite. # If omitted or null, 10000 is used. timeout: 10000 - # Configure a simple span processor. @@ -453,22 +509,28 @@ tracer_provider: console: # Configure span limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 - # Configure max span event count. + # Configure max span event count. + # Value must be non-negative. # If omitted or null, 128 is used. event_count_limit: 128 - # Configure max span link count. + # Configure max span link count. + # Value must be non-negative. # If omitted or null, 128 is used. link_count_limit: 128 - # Configure max attributes per span event. + # Configure max attributes per span event. + # Value must be non-negative. # If omitted or null, 128 is used. event_attribute_count_limit: 128 - # Configure max attributes per span link. + # Configure max attributes per span link. + # Value must be non-negative. # If omitted or null, 128 is used. link_attribute_count_limit: 128 # Configure the sampler. diff --git a/examples/sdk-config.yaml b/examples/sdk-config.yaml index 41ff4c3..3739f00 100644 --- a/examples/sdk-config.yaml +++ b/examples/sdk-config.yaml @@ -23,16 +23,19 @@ resource: value: unknown_service # Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits. attribute_limits: - # Configure max attribute value size. + # Configure max attribute value size. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: - # Configure max attribute count. + # Configure max attribute count. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 # Configure text map context propagators. # If omitted, tracecontext and baggage are used. propagator: - # Configure the set of propagators to include in the composite text map propagator. Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. + # Configure the set of propagators to include in the composite text map propagator. + # Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. composite: [ tracecontext, baggage ] # Configure tracer provider. # If omitted, a noop tracer provider is used. @@ -41,16 +44,18 @@ tracer_provider: processors: - # Configure a batch span processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 5000 is used. schedule_delay: 5000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: 512 # Configure exporter. @@ -60,19 +65,24 @@ tracer_provider: # Configure endpoint, including the trace specific path. # If omitted or null, http://localhost:4318/v1/traces is used. endpoint: http://localhost:4318/v1/traces - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 # Configure headers. Entries have higher priority than entries from .headers_list. @@ -80,22 +90,28 @@ tracer_provider: headers: [] # Configure span limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 - # Configure max span event count. + # Configure max span event count. + # Value must be non-negative. # If omitted or null, 128 is used. event_count_limit: 128 - # Configure max span link count. + # Configure max span link count. + # Value must be non-negative. # If omitted or null, 128 is used. link_count_limit: 128 - # Configure max attributes per span event. + # Configure max attributes per span event. + # Value must be non-negative. # If omitted or null, 128 is used. event_attribute_count_limit: 128 - # Configure max attributes per span link. + # Configure max attributes per span link. + # Value must be non-negative. # If omitted or null, 128 is used. link_attribute_count_limit: 128 # Configure the sampler. @@ -135,10 +151,12 @@ meter_provider: readers: - # Configure a periodic metric reader. periodic: - # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Value must be non-negative. # If omitted or null, 60000 is used. interval: 60000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. timeout: 30000 # Configure exporter. @@ -148,31 +166,39 @@ meter_provider: # Configure endpoint, including the metric specific path. # If omitted or null, http://localhost:4318/v1/metrics is used. endpoint: http://localhost:4318/v1/metrics - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: [] - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure temporality preference. + # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, cumulative is used. temporality_preference: cumulative - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure default histogram aggregation. + # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: explicit_bucket_histogram - # Configure the exemplar filter. Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. + # Configure the exemplar filter. + # Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. # If omitted or null, trace_based is used. exemplar_filter: trace_based # Configure logger provider. @@ -182,16 +208,18 @@ logger_provider: processors: - # Configure a batch log record processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 1000 is used. schedule_delay: 1000 - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: 512 # Configure exporter. @@ -199,19 +227,24 @@ logger_provider: # Configure exporter to be OTLP with HTTP transport. otlp_http: endpoint: http://localhost:4318/v1/logs - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 # Configure headers. Entries have higher priority than entries from .headers_list. @@ -219,9 +252,11 @@ logger_provider: headers: [] # Configure log record limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: 128 diff --git a/examples/sdk-migration-config.yaml b/examples/sdk-migration-config.yaml index 9b46533..8ae10fd 100644 --- a/examples/sdk-migration-config.yaml +++ b/examples/sdk-migration-config.yaml @@ -56,16 +56,19 @@ resource: attributes_list: ${OTEL_RESOURCE_ATTRIBUTES} # Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits. attribute_limits: - # Configure max attribute value size. + # Configure max attribute value size. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. + # Configure max attribute count. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_ATTRIBUTE_COUNT_LIMIT:-128} # Configure text map context propagators. # If omitted, tracecontext and baggage are used. propagator: - # Configure the set of propagators to include in the composite text map propagator. Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. + # Configure the set of propagators to include in the composite text map propagator. + # Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. composite: [ tracecontext, baggage ] # Configure tracer provider. # If omitted, a noop tracer provider is used. @@ -74,16 +77,18 @@ tracer_provider: processors: - # Configure a batch span processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 5000 is used. schedule_delay: ${OTEL_BSP_SCHEDULE_DELAY:-5000} - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: ${OTEL_BSP_EXPORT_TIMEOUT:-30000} - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048} - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: ${OTEL_BSP_MAX_EXPORT_BATCH_SIZE:-512} # Configure exporter. @@ -93,19 +98,24 @@ tracer_provider: # Configure endpoint, including the trace specific path. # If omitted or null, http://localhost:4318/v1/traces is used. endpoint: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-http://localhost:4318/v1/traces} - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: ${OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE} - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY} - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE} - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: ${OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:-10000} # Configure headers. Entries have higher priority than entries from .headers_list. @@ -117,22 +127,28 @@ tracer_provider: headers_list: ${OTEL_EXPORTER_OTLP_TRACES_HEADERS} # Configure span limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:-128} - # Configure max span event count. + # Configure max span event count. + # Value must be non-negative. # If omitted or null, 128 is used. event_count_limit: ${OTEL_SPAN_EVENT_COUNT_LIMIT:-128} - # Configure max span link count. + # Configure max span link count. + # Value must be non-negative. # If omitted or null, 128 is used. link_count_limit: ${OTEL_SPAN_LINK_COUNT_LIMIT:-128} - # Configure max attributes per span event. + # Configure max attributes per span event. + # Value must be non-negative. # If omitted or null, 128 is used. event_attribute_count_limit: ${OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT:-128} - # Configure max attributes per span link. + # Configure max attributes per span link. + # Value must be non-negative. # If omitted or null, 128 is used. link_attribute_count_limit: ${OTEL_LINK_ATTRIBUTE_COUNT_LIMIT:-128} # Configure the sampler. @@ -174,10 +190,12 @@ meter_provider: readers: - # Configure a periodic metric reader. periodic: - # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Configure delay interval (in milliseconds) between start of two consecutive exports. + # Value must be non-negative. # If omitted or null, 60000 is used. interval: ${OTEL_METRIC_EXPORT_INTERVAL:-60000} - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. timeout: ${OTEL_METRIC_EXPORT_TIMEOUT:-30000} # Configure exporter. @@ -187,19 +205,24 @@ meter_provider: # Configure endpoint, including the metric specific path. # If omitted or null, http://localhost:4318/v1/metrics is used. endpoint: ${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:-http://localhost:4318/v1/metrics} - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: ${OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE} - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY} - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE} - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: ${OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:-10000} # Configure headers. Entries have higher priority than entries from .headers_list. @@ -209,13 +232,16 @@ meter_provider: # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. # If omitted or null, no headers are added. headers_list: ${OTEL_EXPORTER_OTLP_METRICS_HEADERS} - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure temporality preference. + # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, cumulative is used. temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative} - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # Configure default histogram aggregation. + # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: ${OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION:-explicit_bucket_histogram} - # Configure the exemplar filter. Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. + # Configure the exemplar filter. + # Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. # If omitted or null, trace_based is used. exemplar_filter: ${OTEL_METRICS_EXEMPLAR_FILTER:-trace_based} # Configure logger provider. @@ -225,16 +251,18 @@ logger_provider: processors: - # Configure a batch log record processor. batch: - # Configure delay interval (in milliseconds) between two consecutive exports. + # Configure delay interval (in milliseconds) between two consecutive exports. + # Value must be non-negative. # If omitted or null, 1000 is used. schedule_delay: ${OTEL_BLRP_SCHEDULE_DELAY:-1000} - # Configure maximum allowed time (in milliseconds) to export data. + # Configure maximum allowed time (in milliseconds) to export data. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 30000 is used. export_timeout: ${OTEL_BLRP_EXPORT_TIMEOUT:-30000} - # Configure maximum queue size. + # Configure maximum queue size. Value must be positive. # If omitted or null, 2048 is used. max_queue_size: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048} - # Configure maximum batch size. + # Configure maximum batch size. Value must be positive. # If omitted or null, 512 is used. max_export_batch_size: ${OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:-512} # Configure exporter. @@ -242,19 +270,24 @@ logger_provider: # Configure exporter to be OTLP with HTTP transport. otlp_http: endpoint: ${OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:-http://localhost:4318/v1/logs} - # Configure certificate. Absolute path to certificate file. + # Configure certificate. + # Absolute path to certificate file. # If omitted or null, system default certificate verification is used for secure connections. certificate: ${OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE} - # Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + # Configure mTLS private client key. + # Absolute path to client key in PEM format. If set, .client_certificate must also be set. # If omitted or null, mTLS is not used. client_key: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY} - # Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + # Configure mTLS client certificate. + # Absolute path to certificate file. If set, .client_key must also be set. # If omitted or null, mTLS is not used. client_certificate: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE} - # Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + # Configure compression. + # Values include: gzip, none. Implementations may support other compression algorithms. # If omitted or null, none is used. compression: ${OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. + # Configure max time (in milliseconds) to wait for each export. + # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:-10000} # Configure headers. Entries have higher priority than entries from .headers_list. @@ -266,9 +299,11 @@ logger_provider: headers_list: ${OTEL_EXPORTER_OTLP_LOGS_HEADERS} # Configure log record limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + # Value must be non-negative. # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + # Value must be non-negative. # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:-128} diff --git a/schema/logger_provider.json b/schema/logger_provider.json index 52f6bf0..36a8820 100644 --- a/schema/logger_provider.json +++ b/schema/logger_provider.json @@ -45,11 +45,11 @@ }, "max_queue_size": { "type": ["integer", "null"], - "minimum": 0 + "exclusiveMinimum": 0 }, "max_export_batch_size": { "type": ["integer", "null"], - "minimum": 0 + "exclusiveMinimum": 0 }, "exporter": { "$ref": "#/$defs/LogRecordExporter" diff --git a/schema/tracer_provider.json b/schema/tracer_provider.json index 1471278..e48d293 100644 --- a/schema/tracer_provider.json +++ b/schema/tracer_provider.json @@ -37,11 +37,11 @@ }, "max_queue_size": { "type": ["integer", "null"], - "minimum": 0 + "exclusiveMinimum": 0 }, "max_export_batch_size": { "type": ["integer", "null"], - "minimum": 0 + "exclusiveMinimum": 0 }, "exporter": { "$ref": "#/$defs/SpanExporter" diff --git a/schema/type_descriptions.yaml b/schema/type_descriptions.yaml index f068da1..0ce19ba 100644 --- a/schema/type_descriptions.yaml +++ b/schema/type_descriptions.yaml @@ -98,11 +98,15 @@ - type: AttributeLimits property_descriptions: attribute_value_length_limit: > - Configure max attribute value size. + Configure max attribute value size. + + Value must be non-negative. If omitted or null, there is no limit. attribute_count_limit: > - Configure max attribute count. + Configure max attribute count. + + Value must be non-negative. If omitted or null, 128 is used. path_patterns: @@ -111,7 +115,9 @@ - type: Propagator property_descriptions: composite: > - Configure the set of propagators to include in the composite text map propagator. Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. + Configure the set of propagators to include in the composite text map propagator. + + Built-in values include: tracecontext, baggage, b3, b3multi, jaeger, none. Known third party values include: xray, ottrace. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration. path_patterns: - .propagator # END OpenTelemetryConfiguration @@ -134,19 +140,23 @@ - type: BatchLogRecordProcessor property_descriptions: schedule_delay: > - Configure delay interval (in milliseconds) between two consecutive exports. + Configure delay interval (in milliseconds) between two consecutive exports. + + Value must be non-negative. If omitted or null, 1000 is used. export_timeout: > - Configure maximum allowed time (in milliseconds) to export data. + Configure maximum allowed time (in milliseconds) to export data. + + Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used. max_queue_size: > - Configure maximum queue size. + Configure maximum queue size. Value must be positive. If omitted or null, 2048 is used. max_export_batch_size: > - Configure maximum batch size. + Configure maximum batch size. Value must be positive. If omitted or null, 512 is used. exporter: Configure exporter. @@ -170,11 +180,15 @@ - type: LogRecordLimits property_descriptions: attribute_value_length_limit: > - Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + + Value must be non-negative. If omitted or null, there is no limit. attribute_count_limit: > - Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + + Value must be non-negative. If omitted or null, 128 is used. path_patterns: @@ -203,19 +217,23 @@ - type: BatchSpanProcessor property_descriptions: schedule_delay: > - Configure delay interval (in milliseconds) between two consecutive exports. + Configure delay interval (in milliseconds) between two consecutive exports. + + Value must be non-negative. If omitted or null, 5000 is used. export_timeout: > - Configure maximum allowed time (in milliseconds) to export data. + Configure maximum allowed time (in milliseconds) to export data. + + Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used. max_queue_size: > - Configure maximum queue size. + Configure maximum queue size. Value must be positive. If omitted or null, 2048 is used. max_export_batch_size: > - Configure maximum batch size. + Configure maximum batch size. Value must be positive. If omitted or null, 512 is used. exporter: Configure exporter. @@ -244,7 +262,9 @@ If omitted or null, http://localhost:9411/api/v2/spans is used. timeout: > - Configure max time (in milliseconds) to wait for each export. + Configure max time (in milliseconds) to wait for each export. + + Value must be non-negative. A value of 0 indicates indefinite. If omitted or null, 10000 is used. path_patterns: @@ -253,27 +273,39 @@ - type: SpanLimits property_descriptions: attribute_value_length_limit: > - Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + + Value must be non-negative. If omitted or null, there is no limit. attribute_count_limit: > - Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + + Value must be non-negative. If omitted or null, 128 is used. event_count_limit: > - Configure max span event count. + Configure max span event count. + + Value must be non-negative. If omitted or null, 128 is used. link_count_limit: > - Configure max span link count. + Configure max span link count. + + Value must be non-negative. If omitted or null, 128 is used. event_attribute_count_limit: > - Configure max attributes per span event. + Configure max attributes per span event. + + Value must be non-negative. If omitted or null, 128 is used. link_attribute_count_limit: > - Configure max attributes per span link. + Configure max attributes per span link. + + Value must be non-negative. If omitted or null, 128 is used. path_patterns: @@ -318,9 +350,14 @@ - type: MeterProvider property_descriptions: readers: Configure metric readers. - views: Configure views. Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). + views: > + Configure views. + + Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). exemplar_filter: > - Configure the exemplar filter. Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. + Configure the exemplar filter. + + Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. If omitted or null, trace_based is used. path_patterns: @@ -343,11 +380,15 @@ - type: PeriodicMetricReader property_descriptions: interval: > - Configure delay interval (in milliseconds) between start of two consecutive exports. + Configure delay interval (in milliseconds) between start of two consecutive exports. + + Value must be non-negative. If omitted or null, 60000 is used. timeout: > - Configure maximum allowed time (in milliseconds) to export data. + Configure maximum allowed time (in milliseconds) to export data. + + Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used. exporter: Configure exporter. @@ -418,7 +459,10 @@ - type: View property_descriptions: - selector: Configure view selector. Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. + selector: > + Configure view selector. + + Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. stream: Configure view stream. path_patterns: - .meter_provider.views[] @@ -463,7 +507,9 @@ If omitted or null, the instrument's origin description is used. aggregation: > - Configure aggregation of the resulting stream(s). Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#aggregation. + Configure aggregation of the resulting stream(s). + + Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#aggregation. If omitted, default is used. attribute_keys: > @@ -508,15 +554,21 @@ - type: OtlpExporterCommon property_descriptions: certificate: > - Configure certificate. Absolute path to certificate file. + Configure certificate. + + Absolute path to certificate file. If omitted or null, system default certificate verification is used for secure connections. client_key: > - Configure mTLS private client key. Absolute path to client key in PEM format. If set, .client_certificate must also be set. + Configure mTLS private client key. + + Absolute path to client key in PEM format. If set, .client_certificate must also be set. If omitted or null, mTLS is not used. client_certificate: > - Configure mTLS client certificate. Absolute path to certificate file. If set, .client_key must also be set. + Configure mTLS client certificate. + + Absolute path to certificate file. If set, .client_key must also be set. If omitted or null, mTLS is not used. headers: > @@ -530,19 +582,27 @@ If omitted or null, no headers are added. compression: > - Configure compression. Values include: gzip, none. Implementations may support other compression algorithms. + Configure compression. + + Values include: gzip, none. Implementations may support other compression algorithms. If omitted or null, none is used. timeout: > - Configure max time (in milliseconds) to wait for each export. + Configure max time (in milliseconds) to wait for each export. + + Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 10000 is used. temporality_preference: > - Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + Configure temporality preference. + + Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. If omitted or null, cumulative is used. default_histogram_aggregation: > - Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + Configure default histogram aggregation. + + Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. If omitted or null, explicit_bucket_histogram is used. path_patterns: @@ -555,7 +615,9 @@ - type: OtlpHttpExporter property_descriptions: encoding: > - Configure the encoding used for messages. Values include: protobuf, json. Implementations may not support json. + Configure the encoding used for messages. + + Values include: protobuf, json. Implementations may not support json. If omitted or null, protobuf is used. path_patterns: @@ -593,7 +655,9 @@ If omitted or null, http://localhost:4317 is used. insecure: > - Configure client transport security for the exporter's connection. Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + Configure client transport security for the exporter's connection. + + Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. If omitted or null, false is used. path_patterns: From 30fb26e948c6e2fc2233ac5bf917f14cbef24f13 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Thu, 16 Jan 2025 04:48:04 +1100 Subject: [PATCH 2/4] Add otlp_file exporter (#154) * Add otlp_file exporter Adding the in-development otlp_file exporter from https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/specification/protocol/file-exporter.md * apply review feedback document and add examples for file:// and stdout methods of defining output_stream expand kitchen-sink examples * Formatting in type_descriptions.yaml --------- Co-authored-by: Jack Berg --- examples/kitchen-sink.yaml | 72 +++++++++++++++++++++++++++++++++++ schema/common.json | 9 +++++ schema/logger_provider.json | 3 ++ schema/meter_provider.json | 18 +++++++++ schema/tracer_provider.json | 3 ++ schema/type_descriptions.yaml | 15 ++++++++ 6 files changed, 120 insertions(+) diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index a3228b4..0faad09 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -123,6 +123,26 @@ logger_provider: # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. # If omitted or null, false is used. insecure: false + - # Configure a batch log record processor. + batch: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: file:///var/log/logs.jsonl + - # Configure a batch log record processor. + batch: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: stdout - # Configure a simple log record processor. simple: # Configure exporter. @@ -297,6 +317,38 @@ meter_provider: # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram + - # Configure a periodic metric reader. + periodic: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: file:///var/log/metrics.jsonl + # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # If omitted or null, cumulative is used. + temporality_preference: delta + # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # If omitted or null, explicit_bucket_histogram is used. + default_histogram_aggregation: base2_exponential_bucket_histogram + - # Configure a periodic metric reader. + periodic: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: stdout + # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # If omitted or null, cumulative is used. + temporality_preference: delta + # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. + # If omitted or null, explicit_bucket_histogram is used. + default_histogram_aggregation: base2_exponential_bucket_histogram - # Configure a periodic metric reader. periodic: # Configure exporter. @@ -488,6 +540,26 @@ tracer_provider: # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. # If omitted or null, false is used. insecure: false + - # Configure a batch span processor. + batch: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: file:///var/log/traces.jsonl + - # Configure a batch span processor. + batch: + # Configure exporter. + exporter: + # Configure exporter to be OTLP with file transport. + otlp_file: + # Configure output stream. + # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + # If omitted or null, stdout is used. + output_stream: stdout - # Configure a batch span processor. batch: # Configure exporter. diff --git a/schema/common.json b/schema/common.json index 6ee683f..acb52c4 100644 --- a/schema/common.json +++ b/schema/common.json @@ -116,6 +116,15 @@ } } }, + "OtlpFileExporter": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "output_stream": { + "type": ["string", "null"] + } + } + }, "ConsoleExporter": { "type": ["object", "null"], "additionalProperties": false diff --git a/schema/logger_provider.json b/schema/logger_provider.json index 36a8820..3b7bbd1 100644 --- a/schema/logger_provider.json +++ b/schema/logger_provider.json @@ -71,6 +71,9 @@ "otlp_grpc": { "$ref": "common.json#/$defs/OtlpGrpcExporter" }, + "otlp_file": { + "$ref": "common.json#/$defs/OtlpFileExporter" + }, "console": { "$ref": "common.json#/$defs/ConsoleExporter" } diff --git a/schema/meter_provider.json b/schema/meter_provider.json index 5dd33ad..25c4056 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -88,6 +88,9 @@ "otlp_grpc": { "$ref": "#/$defs/OtlpGrpcMetricExporter" }, + "otlp_file": { + "$ref": "#/$defs/OtlpFileMetricExporter" + }, "console": { "$ref": "common.json#/$defs/ConsoleExporter" } @@ -279,6 +282,21 @@ } } }, + "OtlpFileMetricExporter": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "output_stream": { + "type": ["string", "null"] + }, + "temporality_preference": { + "$ref": "#/$defs/ExporterTemporalityPreference" + }, + "default_histogram_aggregation": { + "$ref": "#/$defs/ExporterDefaultHistogramAggregation" + } + } + }, "View": { "type": "object", "additionalProperties": false, diff --git a/schema/tracer_provider.json b/schema/tracer_provider.json index e48d293..de4b9e9 100644 --- a/schema/tracer_provider.json +++ b/schema/tracer_provider.json @@ -143,6 +143,9 @@ "otlp_grpc": { "$ref": "common.json#/$defs/OtlpGrpcExporter" }, + "otlp_file": { + "$ref": "common.json#/$defs/OtlpFileExporter" + }, "console": { "$ref": "common.json#/$defs/ConsoleExporter" }, diff --git a/schema/type_descriptions.yaml b/schema/type_descriptions.yaml index 0ce19ba..d304e83 100644 --- a/schema/type_descriptions.yaml +++ b/schema/type_descriptions.yaml @@ -173,6 +173,7 @@ property_descriptions: otlp_http: Configure exporter to be OTLP with HTTP transport. otlp_grpc: Configure exporter to be OTLP with gRPC transport. + otlp_file: Configure exporter to be OTLP with file transport. console: Configure exporter to be console. path_patterns: - .logger_provider.processors[].*.exporter @@ -250,6 +251,7 @@ property_descriptions: otlp_http: Configure exporter to be OTLP with HTTP transport. otlp_grpc: Configure exporter to be OTLP with gRPC transport. + otlp_file: Configure exporter to be OTLP with file transport. zipkin: Configure exporter to be zipkin. console: Configure exporter to be console. path_patterns: @@ -409,6 +411,7 @@ prometheus: Configure exporter to be prometheus. otlp_http: Configure exporter to be OTLP with HTTP transport. otlp_grpc: Configure exporter to be OTLP with gRPC transport. + otlp_file: Configure exporter to be OTLP with file transport. console: Configure exporter to be console. path_patterns: - .meter_provider.readers[].*.exporter @@ -664,6 +667,18 @@ - .tracer_provider.processors[].*.exporter.otlp_grpc - .logger_provider.processors[].*.exporter.otlp_grpc - .meter_provider.readers[].periodic.exporter.otlp_grpc +- type: OtlpFileExporter + property_descriptions: + output_stream: > + Configure output stream. + + Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + + If omitted or null, stdout is used. + path_patterns: + - .tracer_provider.processors[].*.exporter.otlp_file + - .logger_provider.processors[].*.exporter.otlp_file + - .meter_provider.readers[].periodic.exporter.otlp_file # END common # START Instrumentation From aab870dbeeaa61e4b3b63fe4e4b2392a8e986c4e Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:29:56 -0600 Subject: [PATCH 3/4] Clarify JSON schema draft 2020-12 (#156) --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 003d1e8..959eef5 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,12 @@ Allowable changes: The following rules are enforced when modeling the configuration schema: +### Which JSON schema version? + +The schema is modeled using JSON schema [draft 2020-12](https://json-schema.org/draft/2020-12). + +This is reflected in top level schema documents by setting `"$schema": "https://json-schema.org/draft/2020-12/schema"`. + ### What properties are part of schema? Only properties which are described in [opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification) or [semantic-conventions](https://github.com/open-telemetry/semantic-conventions) are modeled in the schema. However, it's acceptable to allow additional properties specific to a particular language or implementation, and not covered by the schema. Model these by setting `"additionalProperties": true` (see [JSON schema additionalProperties](https://json-schema.org/understanding-json-schema/reference/object#additionalproperties)). Types should set `"additionalProperties": false` by default unless requested by an opentelemetry component [maintainer](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer) which supports additional options. From 134fa1e3d13326720184d06f42f8ac24e9041bb1 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:33:27 -0600 Subject: [PATCH 4/4] Object and enum types should be defined in $defs (#155) * Object and enum types should be defined in * fix typo --- README.md | 60 ++++++++- schema/common.json | 15 ++- schema/instrumentation.json | 102 ++++++++------- schema/meter_provider.json | 254 ++++++++++++++++++++---------------- schema/resource.json | 27 ++-- schema/tracer_provider.json | 103 ++++++++------- 6 files changed, 338 insertions(+), 223 deletions(-) diff --git a/README.md b/README.md index 959eef5..fb2ee71 100644 --- a/README.md +++ b/README.md @@ -178,19 +178,75 @@ Another example: ] }, "type": { - "type": ["string", "null"], - "enum": [null, "string", "bool", "int", "double", "string_array", "bool_array", "int_array", "double_array"] + "$ref": "#/$defs/AttributeType" } }, "required": [ "name", "value" ] + }, + "AttributeType": { + "type": ["string", "null"], + "enum": [ + null, + "string", + "bool", + "int", + "double", + "string_array", + "bool_array", + "int_array", + "double_array" + ] } } ``` `oneOf` is used to specify that the `value` property matches the [standard attribute](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/common#standard-attribute) definition, and is either a primitive or array of primitives. This type of use is acceptable but should be used judiciously. +## Schemas and subschemas + +In JSON Schema, a [schema](https://json-schema.org/learn/glossary#schema) is a document, and a [subschema](https://json-schema.org/learn/glossary#subschema) is contained in surrounding parent schema. Subschemas can be nested in various ways: + +A property can directly describe a complex set of requirements including nested structures: + +```json +{ + "properties": { + "shape": { + "type": "object", + "properties": { + "color": { "type": "string" }, + "sides": { "type": "int" } + } + } + } +} +``` + +Or a property can reference a subschema residing in a schema document's [$defs](https://json-schema.org/understanding-json-schema/structuring#defs): + +```json +{ + "properties": { + "shape": { + "$ref": "#/$defs/Shape" + } + }, + "$defs": { + "Shape": { + "type": "object", + "properties": { + "color": { "type": "string" }, + "sides": { "type": "int" } + } + } + } +} +``` + +In order to promote stylistic consistency and allow for reuse of concepts, `object` and `enum` types should be defined in either as a top level schema document or as a subschema in a schema document's `$defs`. + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/schema/common.json b/schema/common.json index acb52c4..1c02cd0 100644 --- a/schema/common.json +++ b/schema/common.json @@ -56,7 +56,7 @@ "headers": { "type": "array", "items": { - "$ref": "common.json#/$defs/NameStringValuePair" + "$ref": "#/$defs/NameStringValuePair" } }, "headers_list": { @@ -70,14 +70,17 @@ "minimum": 0 }, "encoding": { - "type": ["string", "null"], - "enum": [ - "protobuf", - "json" - ] + "$ref": "#/$defs/OtlpHttpEncoding" } } }, + "OtlpHttpEncoding": { + "type": ["string", "null"], + "enum": [ + "protobuf", + "json" + ] + }, "OtlpGrpcExporter": { "title": "OtlpGrpcExporter", "type": ["object", "null"], diff --git a/schema/instrumentation.json b/schema/instrumentation.json index cf93ef6..53a2822 100644 --- a/schema/instrumentation.json +++ b/schema/instrumentation.json @@ -53,68 +53,74 @@ "additionalProperties": false, "properties": { "peer": { + "$ref": "#/$defs/PeerInstrumentation" + }, + "http": { + "$ref": "#/$defs/HttpInstrumentation" + } + } + }, + "PeerInstrumentation": { + "type": "object", + "additionalProperties": false, + "properties": { + "service_mapping": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "peer": { + "type": "string" + }, + "service": { + "type": "string" + } + }, + "required": [ + "peer", + "service" + ] + } + } + } + }, + "HttpInstrumentation": { + "type": "object", + "additionalProperties": false, + "properties": { + "client": { "type": "object", "additionalProperties": false, "properties": { - "service_mapping": { + "request_captured_headers": { "type": "array", "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "peer": { - "type": "string" - }, - "service": { - "type": "string" - } - }, - "required": [ - "peer", - "service" - ] + "type": "string" + } + }, + "response_captured_headers": { + "type": "array", + "items": { + "type": "string" } } } }, - "http": { + "server": { "type": "object", "additionalProperties": false, "properties": { - "client": { - "type": "object", - "additionalProperties": false, - "properties": { - "request_captured_headers": { - "type": "array", - "items": { - "type": "string" - } - }, - "response_captured_headers": { - "type": "array", - "items": { - "type": "string" - } - } + "request_captured_headers": { + "type": "array", + "items": { + "type": "string" } }, - "server": { - "type": "object", - "additionalProperties": false, - "properties": { - "request_captured_headers": { - "type": "array", - "items": { - "type": "string" - } - }, - "response_captured_headers": { - "type": "array", - "items": { - "type": "string" - } - } + "response_captured_headers": { + "type": "array", + "items": { + "type": "string" } } } diff --git a/schema/meter_provider.json b/schema/meter_provider.json index 25c4056..5a0f163 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -18,18 +18,21 @@ } }, "exemplar_filter": { - "type": ["string", "null"], - "enum": [ - "always_on", - "always_off", - "trace_based" - ] + "$ref": "#/$defs/ExemplarFilter" } }, "required": [ "readers" ], "$defs": { + "ExemplarFilter": { + "type": ["string", "null"], + "enum": [ + "always_on", + "always_off", + "trace_based" + ] + }, "PeriodicMetricReader": { "type": "object", "additionalProperties": false, @@ -124,8 +127,7 @@ "maxProperties": 1, "properties": { "opencensus": { - "type": ["object", "null"], - "additionalProperties": false + "$ref": "#/$defs/OpenCensusMetricProducer" } }, "patternProperties": { @@ -134,6 +136,10 @@ } } }, + "OpenCensusMetricProducer": { + "type": ["object", "null"], + "additionalProperties": false + }, "PrometheusMetricExporter": { "title": "PrometheusMetricExporter", "type": ["object", "null"], @@ -224,11 +230,7 @@ "minimum": 0 }, "encoding": { - "type": ["string", "null"], - "enum": [ - "protobuf", - "json" - ] + "$ref": "common.json#/$defs/OtlpHttpEncoding" }, "temporality_preference": { "$ref": "#/$defs/ExporterTemporalityPreference" @@ -302,109 +304,139 @@ "additionalProperties": false, "properties": { "selector": { - "title": "Selector", - "type": "object", - "additionalProperties": false, - "properties": { - "instrument_name": { - "type": ["string", "null"] - }, - "instrument_type": { - "type": ["string", "null"], - "enum": [ - "counter", - "histogram", - "observable_counter", - "observable_gauge", - "observable_up_down_counter", - "up_down_counter" - ] - }, - "unit": { - "type": ["string", "null"] - }, - "meter_name": { - "type": ["string", "null"] - }, - "meter_version": { - "type": ["string", "null"] - }, - "meter_schema_url": { - "type": ["string", "null"] - } - } + "$ref": "#/$defs/ViewSelector" }, "stream": { - "title": "Stream", - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": ["string", "null"] - }, - "description": { - "type": ["string", "null"] - }, - "aggregation": { - "type": "object", - "additionalProperties": false, - "minProperties": 1, - "maxProperties": 1, - "properties": { - "default": { - "type": ["object", "null"], - "additionalProperties": false - }, - "drop": { - "type": ["object", "null"], - "additionalProperties": false - }, - "explicit_bucket_histogram": { - "type": ["object", "null"], - "additionalProperties": false, - "properties": { - "boundaries": { - "type": "array", - "items": { - "type": "number" - } - }, - "record_min_max": { - "type": ["boolean", "null"] - } - } - }, - "base2_exponential_bucket_histogram": { - "type": ["object", "null"], - "additionalProperties": false, - "properties": { - "max_scale": { - "type": ["integer", "null"] - }, - "max_size": { - "type": ["integer", "null"] - }, - "record_min_max": { - "type": ["boolean", "null"] - } - } - }, - "last_value": { - "type": ["object", "null"], - "additionalProperties": false - }, - "sum": { - "type": ["object", "null"], - "additionalProperties": false - } - } - }, - "attribute_keys": { - "$ref": "common.json#/$defs/IncludeExclude" - } + "$ref": "#/$defs/ViewStream" + } + } + }, + "ViewSelector": { + "title": "Selector", + "type": "object", + "additionalProperties": false, + "properties": { + "instrument_name": { + "type": ["string", "null"] + }, + "instrument_type": { + "$ref": "#/$defs/InstrumentType" + }, + "unit": { + "type": ["string", "null"] + }, + "meter_name": { + "type": ["string", "null"] + }, + "meter_version": { + "type": ["string", "null"] + }, + "meter_schema_url": { + "type": ["string", "null"] + } + } + }, + "InstrumentType": { + "type": ["string", "null"], + "enum": [ + "counter", + "histogram", + "observable_counter", + "observable_gauge", + "observable_up_down_counter", + "up_down_counter" + ] + }, + "ViewStream": { + "title": "Stream", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + }, + "aggregation": { + "$ref": "#/$defs/Aggregation" + }, + "attribute_keys": { + "$ref": "common.json#/$defs/IncludeExclude" + } + } + }, + "Aggregation": { + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "maxProperties": 1, + "properties": { + "default": { + "$ref": "#/$defs/DefaultAggregation" + }, + "drop": { + "$ref": "#/$defs/DropAggregation" + }, + "explicit_bucket_histogram": { + "$ref": "#/$defs/ExplicitBucketHistogramAggregation" + }, + "base2_exponential_bucket_histogram": { + "$ref": "#/$defs/Base2ExponentialBucketHistogramAggregation" + }, + "last_value": { + "$ref": "#/$defs/LastValueAggregation" + }, + "sum": { + "$ref": "#/$defs/SumAggregation" + } + } + }, + "DefaultAggregation": { + "type": ["object", "null"], + "additionalProperties": false + }, + "DropAggregation": { + "type": ["object", "null"], + "additionalProperties": false + }, + "ExplicitBucketHistogramAggregation": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "boundaries": { + "type": "array", + "items": { + "type": "number" } + }, + "record_min_max": { + "type": ["boolean", "null"] + } + } + }, + "Base2ExponentialBucketHistogramAggregation": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "max_scale": { + "type": ["integer", "null"] + }, + "max_size": { + "type": ["integer", "null"] + }, + "record_min_max": { + "type": ["boolean", "null"] } } + }, + "LastValueAggregation": { + "type": ["object", "null"], + "additionalProperties": false + }, + "SumAggregation": { + "type": ["object", "null"], + "additionalProperties": false } } } diff --git a/schema/resource.json b/schema/resource.json index b419546..1b3cf43 100644 --- a/schema/resource.json +++ b/schema/resource.json @@ -42,24 +42,27 @@ ] }, "type": { - "type": ["string", "null"], - "enum": [ - null, - "string", - "bool", - "int", - "double", - "string_array", - "bool_array", - "int_array", - "double_array" - ] + "$ref": "#/$defs/AttributeType" } }, "required": [ "name", "value" ] }, + "AttributeType": { + "type": ["string", "null"], + "enum": [ + null, + "string", + "bool", + "int", + "double", + "string_array", + "bool_array", + "int_array", + "double_array" + ] + }, "Detectors": { "title": "Detectors", "type": "object", diff --git a/schema/tracer_provider.json b/schema/tracer_provider.json index de4b9e9..2a0e704 100644 --- a/schema/tracer_provider.json +++ b/schema/tracer_provider.json @@ -58,58 +58,19 @@ "maxProperties": 1, "properties": { "always_off": { - "type": ["object", "null"], - "additionalProperties": false + "$ref": "#/$defs/AlwaysOffSampler" }, "always_on": { - "type": ["object", "null"], - "additionalProperties": false + "$ref": "#/$defs/AlwaysOnSampler" }, "jaeger_remote": { - "type": ["object", "null"], - "additionalProperties": false, - "properties": { - "endpoint": { - "type": ["string", "null"] - }, - "interval": { - "type": ["integer", "null"], - "minimum": 0 - }, - "initial_sampler": { - "$ref": "#/$defs/Sampler" - } - } + "$ref": "#/$defs/JaegerRemoteSampler" }, "parent_based": { - "type": ["object", "null"], - "additionalProperties": false, - "properties": { - "root": { - "$ref": "#/$defs/Sampler" - }, - "remote_parent_sampled": { - "$ref": "#/$defs/Sampler" - }, - "remote_parent_not_sampled": { - "$ref": "#/$defs/Sampler" - }, - "local_parent_sampled": { - "$ref": "#/$defs/Sampler" - }, - "local_parent_not_sampled": { - "$ref": "#/$defs/Sampler" - } - } + "$ref": "#/$defs/ParentBasedSampler" }, "trace_id_ratio_based": { - "type": ["object", "null"], - "additionalProperties": false, - "properties": { - "ratio": { - "type": ["number", "null"] - } - } + "$ref": "#/$defs/TraceIdRatioBasedSampler" } }, "patternProperties": { @@ -118,6 +79,60 @@ } } }, + "AlwaysOffSampler": { + "type": ["object", "null"], + "additionalProperties": false + }, + "AlwaysOnSampler": { + "type": ["object", "null"], + "additionalProperties": false + }, + "JaegerRemoteSampler": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "endpoint": { + "type": ["string", "null"] + }, + "interval": { + "type": ["integer", "null"], + "minimum": 0 + }, + "initial_sampler": { + "$ref": "#/$defs/Sampler" + } + } + }, + "ParentBasedSampler": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "root": { + "$ref": "#/$defs/Sampler" + }, + "remote_parent_sampled": { + "$ref": "#/$defs/Sampler" + }, + "remote_parent_not_sampled": { + "$ref": "#/$defs/Sampler" + }, + "local_parent_sampled": { + "$ref": "#/$defs/Sampler" + }, + "local_parent_not_sampled": { + "$ref": "#/$defs/Sampler" + } + } + }, + "TraceIdRatioBasedSampler": { + "type": ["object", "null"], + "additionalProperties": false, + "properties": { + "ratio": { + "type": ["number", "null"] + } + } + }, "SimpleSpanProcessor": { "type": "object", "additionalProperties": false,