Skip to content

Commit

Permalink
Add metric producers to meter_provider configuration (#90)
Browse files Browse the repository at this point in the history
Part of open-telemetry/opentelemetry-specification#4015

Metric producers are registered to metric readers, so i've nested it under the periodic and manual readers.
  • Loading branch information
dashpole authored May 23, 2024
1 parent 28fe6c3 commit 0941a0a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ meter_provider:
# Configure resource attributes to be excluded, in this example attribute service.attr1.
excluded:
- "service.attr1"
# Configure metric producers.
producers:
# Configure metric producer to be opencensus
- opencensus: {}
# Configure a periodic metric reader.
- periodic:
# Configure delay interval (in milliseconds) between start of two consecutive exports.
Expand Down Expand Up @@ -203,6 +207,10 @@ meter_provider:
#
# Environment variable: OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION
default_histogram_aggregation: base2_exponential_bucket_histogram
# Configure metric producers.
producers:
# Configure metric producer to be prometheus
- prometheus: {}
# Configure a periodic metric reader.
- periodic:
# Configure exporter.
Expand Down
31 changes: 30 additions & 1 deletion schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
"properties": {
"exporter": {
"$ref": "#/$defs/MetricExporter"
},
"producers": {
"type": "array",
"items": {
"$ref": "#/$defs/MetricProducer"
}
}
},
"required": [
Expand Down Expand Up @@ -75,6 +81,23 @@
}
}
},
"MetricProducer": {
"type": "object",
"additionalProperties": true,
"minProperties": 1,
"maxProperties": 1,
"properties": {
"opencensus": {
"type": "object",
"additionalProperties": false
}
},
"patternProperties": {
".*": {
"type": "object"
}
}
},
"Prometheus": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -103,13 +126,19 @@
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"maxProperties": 1,
"maxProperties": 2,
"properties": {
"periodic": {
"$ref": "#/$defs/PeriodicMetricReader"
},
"pull": {
"$ref": "#/$defs/PullMetricReader"
},
"producers": {
"type": "array",
"items": {
"$ref": "#/$defs/MetricProducer"
}
}
}
},
Expand Down

0 comments on commit 0941a0a

Please sign in to comment.