Skip to content

Commit 8425d9b

Browse files
authored
Refactor propagator schema (#187)
1 parent ebb5dba commit 8425d9b

File tree

5 files changed

+125
-20
lines changed

5 files changed

+125
-20
lines changed

examples/kitchen-sink.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,29 @@ meter_provider:
498498
# If omitted or null, trace_based is used.
499499
exemplar_filter: trace_based
500500
# Configure text map context propagators.
501-
# If omitted, tracecontext and baggage are used.
501+
# If omitted, a noop propagator is used.
502502
propagator:
503-
# Configure the set of propagators to include in the composite text map propagator.
504-
# 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.
505-
composite: [ tracecontext, baggage, b3, b3multi, jaeger, xray, ottrace ]
503+
# Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.
504+
# Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray.
505+
# If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
506+
composite:
507+
- # Include the w3c trace context propagator.
508+
tracecontext:
509+
- # Include the w3c baggage propagator.
510+
baggage:
511+
- # Include the zipkin b3 propagator.
512+
b3:
513+
- # Include the zipkin b3 multi propagator.
514+
b3multi:
515+
- # Include the jaeger propagator.
516+
jaeger:
517+
- # Include the opentracing propagator.
518+
ottrace:
519+
# Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out.
520+
# The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.
521+
# Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray.
522+
# If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
523+
composite_list: "tracecontext,baggage,b3,b3multi,jaeger,ottrace,xray"
506524
# Configure tracer provider.
507525
# If omitted, a noop tracer provider is used.
508526
tracer_provider:

examples/sdk-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ attribute_limits:
3535
# If omitted or null, 128 is used.
3636
attribute_count_limit: 128
3737
# Configure text map context propagators.
38-
# If omitted, tracecontext and baggage are used.
38+
# If omitted, a noop propagator is used.
3939
propagator:
40-
# Configure the set of propagators to include in the composite text map propagator.
41-
# 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.
42-
composite: [ tracecontext, baggage ]
40+
# Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.
41+
# Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray.
42+
# If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
43+
composite:
44+
- # Include the w3c trace context propagator.
45+
tracecontext:
46+
- # Include the w3c baggage propagator.
47+
baggage:
4348
# Configure tracer provider.
4449
# If omitted, a noop tracer provider is used.
4550
tracer_provider:

examples/sdk-migration-config.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# for more information. The following spec defined env vars are NOT referenced and are thus
1515
# ignored:
1616
#
17-
# - OTEL_PROPAGATORS
1817
# - OTEL_TRACES_SAMPLER
1918
# - OTEL_TRACES_SAMPLER_ARG
2019
# - OTEL_EXPORTER_ZIPKIN_ENDPOINT
@@ -67,11 +66,17 @@ attribute_limits:
6766
# If omitted or null, 128 is used.
6867
attribute_count_limit: ${OTEL_ATTRIBUTE_COUNT_LIMIT:-128}
6968
# Configure text map context propagators.
70-
# If omitted, tracecontext and baggage are used.
69+
# If omitted, a noop propagator is used.
7170
propagator:
72-
# Configure the set of propagators to include in the composite text map propagator.
73-
# 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.
74-
composite: [ tracecontext, baggage ]
71+
# Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.
72+
# Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray.
73+
# If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
74+
composite: []
75+
# Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out.
76+
# The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.
77+
# Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray.
78+
# If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
79+
composite_list: ${OTEL_PROPAGATORS:-tracecontext,baggage}
7580
# Configure tracer provider.
7681
# If omitted, a noop tracer provider is used.
7782
tracer_provider:

schema/propagator.json

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,68 @@
66
"composite": {
77
"type": "array",
88
"items": {
9-
"type": ["string"]
9+
"$ref": "#/$defs/TextMapPropagator"
1010
}
11+
},
12+
"composite_list": {
13+
"type": ["string", "null"]
1114
}
1215
},
13-
"required": [
14-
"composite"
15-
]
16+
"$defs": {
17+
"TextMapPropagator": {
18+
"type": "object",
19+
"additionalProperties": true,
20+
"minProperties": 1,
21+
"maxProperties": 1,
22+
"properties": {
23+
"tracecontext": {
24+
"$ref": "#/$defs/TraceContextPropagator"
25+
},
26+
"baggage": {
27+
"$ref": "#/$defs/BaggagePropagator"
28+
},
29+
"b3": {
30+
"$ref": "#/$defs/B3Propagator"
31+
},
32+
"b3multi": {
33+
"$ref": "#/$defs/B3MultiPropagator"
34+
},
35+
"jaeger": {
36+
"$ref": "#/$defs/JaegerPropagator"
37+
},
38+
"ottrace": {
39+
"$ref": "#/$defs/OpenTracingPropagator"
40+
}
41+
},
42+
"patternProperties": {
43+
".*": {
44+
"type": ["object", "null"]
45+
}
46+
}
47+
},
48+
"TraceContextPropagator": {
49+
"type": ["object", "null"],
50+
"additionalProperties": false
51+
},
52+
"BaggagePropagator": {
53+
"type": ["object", "null"],
54+
"additionalProperties": false
55+
},
56+
"B3Propagator": {
57+
"type": ["object", "null"],
58+
"additionalProperties": false
59+
},
60+
"B3MultiPropagator": {
61+
"type": ["object", "null"],
62+
"additionalProperties": false
63+
},
64+
"JaegerPropagator": {
65+
"type": ["object", "null"],
66+
"additionalProperties": false
67+
},
68+
"OpenTracingPropagator": {
69+
"type": ["object", "null"],
70+
"additionalProperties": false
71+
}
72+
}
1673
}

schema/type_descriptions.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
propagator: >
3535
Configure text map context propagators.
3636
37-
If omitted, tracecontext and baggage are used.
37+
If omitted, a noop propagator is used.
3838
attribute_limits: Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.
3939
logger_provider: >
4040
Configure logger provider.
@@ -125,11 +125,31 @@
125125
- type: Propagator
126126
property_descriptions:
127127
composite: >
128-
Configure the set of propagators to include in the composite text map propagator.
128+
Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.
129129
130-
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.
130+
Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray.
131+
132+
If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
133+
composite_list: >
134+
Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out.
135+
136+
The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.
137+
138+
Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray.
139+
140+
If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.
131141
path_patterns:
132142
- .propagator
143+
- type: CompositePropagator
144+
property_descriptions:
145+
tracecontext: Include the w3c trace context propagator.
146+
baggage: Include the w3c baggage propagator.
147+
b3: Include the zipkin b3 propagator.
148+
b3multi: Include the zipkin b3 multi propagator.
149+
jaeger: Include the jaeger propagator.
150+
ottrace: Include the opentracing propagator.
151+
path_patterns:
152+
- .propagator.composite[]
133153
# END OpenTelemetryConfiguration
134154

135155
# START LoggerProvider

0 commit comments

Comments
 (0)