Skip to content

Commit a6b2d44

Browse files
marcalffjack-berg
andauthored
[SCHEMA] The MetricExporter schema is unsafe (#110)
--------- Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
1 parent cc7cd37 commit a6b2d44

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
* Adding initial instrumentation configuration schema
6+
* Split MetricExporter into PullMetricExporter and PushMetricExporter and ensure only PushMetricExporters can be associated with PeriodicMetricReader [#110](https://github.com/open-telemetry/opentelemetry-configuration/pull/110)
67

78
## [v0.2.0] - 2024-05-08
89

schema/meter_provider.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"minimum": 0
3333
},
3434
"exporter": {
35-
"$ref": "#/$defs/MetricExporter"
35+
"$ref": "#/$defs/PushMetricExporter"
3636
}
3737
},
3838
"required": [
@@ -45,15 +45,15 @@
4545
"additionalProperties": false,
4646
"properties": {
4747
"exporter": {
48-
"$ref": "#/$defs/MetricExporter"
48+
"$ref": "#/$defs/PullMetricExporter"
4949
}
5050
},
5151
"required": [
5252
"exporter"
5353
],
5454
"title": "PullMetricReader"
5555
},
56-
"MetricExporter": {
56+
"PushMetricExporter": {
5757
"type": ["object", "null"],
5858
"additionalProperties": true,
5959
"minProperties": 1,
@@ -64,7 +64,20 @@
6464
},
6565
"console": {
6666
"$ref": "common.json#/$defs/Console"
67-
},
67+
}
68+
},
69+
"patternProperties": {
70+
".*": {
71+
"type": ["object", "null"]
72+
}
73+
}
74+
},
75+
"PullMetricExporter": {
76+
"type": ["object", "null"],
77+
"additionalProperties": true,
78+
"minProperties": 1,
79+
"maxProperties": 1,
80+
"properties": {
6881
"prometheus": {
6982
"$ref": "#/$defs/Prometheus"
7083
}

0 commit comments

Comments
 (0)