Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4958](https://github.com/open-telemetry/opentelemetry-python/pull/4958))
- `opentelemetry-sdk`: fix type annotations on `MetricReader` and related types
([#4938](https://github.com/open-telemetry/opentelemetry-python/pull/4938/))
- `opentelemetry-sdk`: upgrade vendored OTel configuration schema from v1.0.0-rc.3 to v1.0.0
([#4965](https://github.com/open-telemetry/opentelemetry-python/pull/4965))

## Version 1.40.0/0.61b0 (2026-03-04)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SDK File Configuration

This package implements [OpenTelemetry file-based configuration](https://opentelemetry.io/docs/specs/otel/configuration/file-configuration/).
Comment thread
MikeGoldsmith marked this conversation as resolved.
Outdated

## Files

- `schema.json` — vendored copy of the [OpenTelemetry configuration JSON schema](https://github.com/open-telemetry/opentelemetry-configuration)
- `models.py` — Python dataclasses generated from `schema.json` by [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator)

## Updating the schema

1. Download the new schema from the [opentelemetry-configuration releases](https://github.com/open-telemetry/opentelemetry-configuration/releases):

```sh
curl -o opentelemetry-sdk/src/opentelemetry/sdk/_configuration/schema.json \
https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/refs/tags/vX.Y.Z/opentelemetry_configuration.json
```

2. Regenerate `models.py`:

```sh
tox -e generate-config-from-jsonschema
```

3. Update any version string references in tests and source:

```sh
grep -r "OLD_VERSION" opentelemetry-sdk/
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
>>> from opentelemetry.sdk._configuration.file import load_config_file
>>> config = load_config_file("otel-config.yaml")
>>> print(config.file_format)
'1.0-rc.3'
'1.0'
"""

from opentelemetry.sdk._configuration.file._env_substitution import (
Expand Down
94 changes: 64 additions & 30 deletions opentelemetry-sdk/src/opentelemetry/sdk/_configuration/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/refs/tags/v1.0.0-rc.3/opentelemetry_configuration.json
# timestamp: 2026-02-19T11:35:13+00:00
# filename: schema.json
# timestamp: 2026-03-11T13:56:48+00:00

from __future__ import annotations

Expand Down Expand Up @@ -122,12 +122,14 @@ class ExperimentalComposableRuleBasedSamplerRuleAttributeValues:
class ExperimentalHttpClientInstrumentation:
request_captured_headers: Optional[list[str]] = None
response_captured_headers: Optional[list[str]] = None
known_methods: Optional[list[str]] = None


@dataclass
class ExperimentalHttpServerInstrumentation:
request_captured_headers: Optional[list[str]] = None
response_captured_headers: Optional[list[str]] = None
known_methods: Optional[list[str]] = None


ExperimentalLanguageSpecificInstrumentation: TypeAlias = dict[
Expand All @@ -137,7 +139,7 @@ class ExperimentalHttpServerInstrumentation:

@dataclass
class ExperimentalMeterConfig:
disabled: Optional[bool] = None
enabled: Optional[bool] = None


@dataclass
Expand All @@ -151,12 +153,6 @@ class ExperimentalOtlpFileExporter:
output_stream: Optional[str] = None


@dataclass
class ExperimentalPeerServiceMapping:
peer: str
service: str


@dataclass
class ExperimentalProbabilitySampler:
ratio: Optional[float] = None
Expand All @@ -167,11 +163,20 @@ class ExperimentalProbabilitySampler:

class ExperimentalPrometheusTranslationStrategy(Enum):
underscore_escaping_with_suffixes = "underscore_escaping_with_suffixes"
underscore_escaping_without_suffixes = (
"underscore_escaping_without_suffixes"
underscore_escaping_without_suffixes_development = (
"underscore_escaping_without_suffixes/development"
)
no_utf8_escaping_with_suffixes_development = (
"no_utf8_escaping_with_suffixes/development"
)
no_utf8_escaping_with_suffixes = "no_utf8_escaping_with_suffixes"
no_translation = "no_translation"
no_translation_development = "no_translation/development"


@dataclass
class ExperimentalSemconvConfig:
version: Optional[int] = None
experimental: Optional[bool] = None
dual_emit: Optional[bool] = None


ExperimentalServiceResourceDetector: TypeAlias = Optional[dict[str, Any]]
Expand All @@ -185,7 +190,7 @@ class ExperimentalSpanParent(Enum):

@dataclass
class ExperimentalTracerConfig:
disabled: Optional[bool] = None
enabled: Optional[bool] = None


@dataclass
Expand All @@ -194,6 +199,11 @@ class ExperimentalTracerMatcherAndConfig:
config: ExperimentalTracerConfig


@dataclass
class ExperimentalUrlSanitization:
sensitive_query_parameters: Optional[list[str]] = None


@dataclass
class ExplicitBucketHistogramAggregation:
boundaries: Optional[list[float]] = None
Expand Down Expand Up @@ -242,9 +252,6 @@ class InstrumentType(Enum):
up_down_counter = "up_down_counter"


JaegerPropagator: TypeAlias = Optional[dict[str, Any]]


LastValueAggregation: TypeAlias = Optional[dict[str, Any]]


Expand All @@ -263,9 +270,6 @@ class NameStringValuePair:
OpenCensusMetricProducer: TypeAlias = Optional[dict[str, Any]]


OpenTracingPropagator: TypeAlias = Optional[dict[str, Any]]


@dataclass
class OtlpGrpcExporter:
endpoint: Optional[str] = None
Expand Down Expand Up @@ -433,15 +437,31 @@ class ConsoleMetricExporter:
] = None


@dataclass
class ExperimentalCodeInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None


@dataclass
class ExperimentalDbInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None


@dataclass
class ExperimentalGenAiInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None


@dataclass
class ExperimentalHttpInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None
client: Optional[ExperimentalHttpClientInstrumentation] = None
server: Optional[ExperimentalHttpServerInstrumentation] = None


@dataclass
class ExperimentalLoggerConfig:
disabled: Optional[bool] = None
enabled: Optional[bool] = None
minimum_severity: Optional[SeverityNumber] = None
trace_based: Optional[bool] = None

Expand All @@ -452,6 +472,11 @@ class ExperimentalLoggerMatcherAndConfig:
config: ExperimentalLoggerConfig


@dataclass
class ExperimentalMessagingInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None


@dataclass
class ExperimentalMeterConfigurator:
default_config: Optional[ExperimentalMeterConfig] = None
Expand All @@ -467,17 +492,12 @@ class ExperimentalOtlpFileMetricExporter:
] = None


@dataclass
class ExperimentalPeerInstrumentation:
service_mapping: Optional[list[ExperimentalPeerServiceMapping]] = None


@dataclass
class ExperimentalPrometheusMetricExporter:
host: Optional[str] = None
port: Optional[int] = None
without_scope_info: Optional[bool] = None
without_target_info: Optional[bool] = None
without_target_info_development: Optional[bool] = None
with_resource_constant_labels: Optional[IncludeExclude] = None
translation_strategy: Optional[
ExperimentalPrometheusTranslationStrategy
Expand All @@ -492,6 +512,16 @@ class ExperimentalResourceDetector:
service: Optional[ExperimentalServiceResourceDetector] = None


@dataclass
class ExperimentalRpcInstrumentation:
semconv: Optional[ExperimentalSemconvConfig] = None


@dataclass
class ExperimentalSanitization:
url: Optional[ExperimentalUrlSanitization] = None


@dataclass
class ExperimentalTracerConfigurator:
default_config: Optional[ExperimentalTracerConfig] = None
Expand Down Expand Up @@ -555,8 +585,6 @@ class TextMapPropagator:
baggage: Optional[BaggagePropagator] = None
b3: Optional[B3Propagator] = None
b3multi: Optional[B3MultiPropagator] = None
jaeger: Optional[JaegerPropagator] = None
ottrace: Optional[OpenTracingPropagator] = None


@dataclass
Expand All @@ -579,8 +607,14 @@ class BatchLogRecordProcessor:

@dataclass
class ExperimentalGeneralInstrumentation:
peer: Optional[ExperimentalPeerInstrumentation] = None
http: Optional[ExperimentalHttpInstrumentation] = None
code: Optional[ExperimentalCodeInstrumentation] = None
db: Optional[ExperimentalDbInstrumentation] = None
gen_ai: Optional[ExperimentalGenAiInstrumentation] = None
messaging: Optional[ExperimentalMessagingInstrumentation] = None
rpc: Optional[ExperimentalRpcInstrumentation] = None
sanitization: Optional[ExperimentalSanitization] = None
stability_opt_in_list: Optional[str] = None


@dataclass
Expand Down
Loading
Loading