Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 5 additions & 11 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"$id": "https://opentelemetry.io/otelconfig/instrumentation.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": false,
"additionalProperties": {
"$ref": "#/$defs/ExperimentalGeneralInstrumentation"
Copy link
Member

@marcalff marcalff Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there is a discrepancy, what was removed in patternProperties is ExperimentalLanguageSpecificInstrumentation.

},
"properties": {
"general": {
"$ref": "#/$defs/ExperimentalGeneralInstrumentation"
Expand Down Expand Up @@ -41,11 +43,6 @@
"$ref": "#/$defs/ExperimentalLanguageSpecificInstrumentation"
}
},
"patternProperties": {
".*": {
"$ref": "#/$defs/ExperimentalLanguageSpecificInstrumentation"
}
},
"$defs": {
"ExperimentalGeneralInstrumentation": {
"type": "object",
Expand Down Expand Up @@ -128,11 +125,8 @@
},
"ExperimentalLanguageSpecificInstrumentation": {
"type": "object",
"additionalProperties": true,
"patternProperties": {
".*": {
"type": "object"
}
"additionalProperties": {
"type": "object"
}
}
}
Expand Down
18 changes: 6 additions & 12 deletions schema/logger_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
},
"LogRecordExporter": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -80,11 +82,6 @@
"console": {
"$ref": "common.json#/$defs/ConsoleExporter"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"LogRecordLimits": {
Expand All @@ -103,7 +100,9 @@
},
"LogRecordProcessor": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -113,11 +112,6 @@
"simple": {
"$ref": "#/$defs/SimpleLogRecordProcessor"
}
},
"patternProperties": {
".*": {
"type": ["object"]
}
}
},
"ExperimentalLoggerConfigurator": {
Expand Down
27 changes: 9 additions & 18 deletions schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@
},
"PushMetricExporter": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -142,43 +144,32 @@
"console": {
"$ref": "common.json#/$defs/ConsoleExporter"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"PullMetricExporter": {
"type": ["object"],
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
"prometheus/development": {
"$ref": "#/$defs/ExperimentalPrometheusMetricExporter"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"MetricProducer": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
"opencensus": {
"$ref": "#/$defs/OpenCensusMetricProducer"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"OpenCensusMetricProducer": {
Expand Down
9 changes: 3 additions & 6 deletions schema/propagator.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"$defs": {
"TextMapPropagator": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -38,11 +40,6 @@
"ottrace": {
"$ref": "#/$defs/OpenTracingPropagator"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"TraceContextPropagator": {
Expand Down
9 changes: 3 additions & 6 deletions schema/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
},
"ExperimentalResourceDetector": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -94,11 +96,6 @@
"service": {
"$ref": "#/$defs/ExperimentalServiceResourceDetector"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"ExperimentalContainerResourceDetector": {
Expand Down
27 changes: 9 additions & 18 deletions schema/tracer_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
},
"Sampler": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -74,11 +76,6 @@
"trace_id_ratio_based": {
"$ref": "#/$defs/TraceIdRatioBasedSampler"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"AlwaysOffSampler": {
Expand Down Expand Up @@ -149,7 +146,9 @@
},
"SpanExporter": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -168,11 +167,6 @@
"zipkin": {
"$ref": "#/$defs/ZipkinSpanExporter"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"SpanLimits": {
Expand Down Expand Up @@ -207,7 +201,9 @@
},
"SpanProcessor": {
"type": "object",
"additionalProperties": true,
"additionalProperties": {
"type": ["object", "null"]
},
"minProperties": 1,
"maxProperties": 1,
"properties": {
Expand All @@ -217,11 +213,6 @@
"simple": {
"$ref": "#/$defs/SimpleSpanProcessor"
}
},
"patternProperties": {
".*": {
"type": ["object", "null"]
}
}
},
"ZipkinSpanExporter": {
Expand Down
2 changes: 1 addition & 1 deletion schema/type_descriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# propertyB: The propertyB description. # The description for MyType.propertyB
# path_patterns: # Array of patterns where this type occurs in the schema. Each key-value in an example configuration file is transformed
# - .foo # into its JSON dot-notation location in the file, which is matched against these patterns. Each pattern is turned in a regex,
# after escaping special characters and replacing "*" with ".*".
# after escaping special characters and replacing "*" with ".+".

# START OpenTelemetryConfiguration
- type: OpenTelemetryConfiguration
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-descriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ if (outputFile === null) {
// Helper functions

// Converts an input pattern to a regular expression.
// Converts any "*" to a ".*".
// Converts any "*" to a ".+".
// Escapes all other regex special characters.
// Prefixes with "^", and adds "$" suffix.
function toRegex(pattern) {
let parts = pattern.split("*");
if (parts.length === 0) parts = [pattern];
const escaped = parts
.map(chunk => chunk.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&"))
.join("(.*)");
.join("(.+)");
return "^" + escaped + "$";
}

Expand Down
Loading