Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric producers to meter_provider configuration #90

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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.
dashpole marked this conversation as resolved.
Show resolved Hide resolved
producers:
dashpole marked this conversation as resolved.
Show resolved Hide resolved
# 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.
dashpole marked this conversation as resolved.
Show resolved Hide resolved
producers:
# Configure metric producer to be prometheus
- prometheus: {}
# Configure a periodic metric reader.
- periodic:
# Configure exporter.
Expand Down
29 changes: 29 additions & 0 deletions 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"
}
}
Comment on lines +49 to 55
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed here if already in the top level MetricReader? If it is required for pull (maybe to control at a granular level) why not for periodic as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#93

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for calling this out @bogdandrutu!

},
"required": [
Expand Down Expand Up @@ -75,6 +81,23 @@
}
}
},
"MetricProducer": {
"type": "object",
"additionalProperties": true,
"minProperties": 1,
"maxProperties": 1,
"properties": {
"opencensus": {
dashpole marked this conversation as resolved.
Show resolved Hide resolved
"type": "object",
"additionalProperties": false
}
},
"patternProperties": {
".*": {
"type": "object"
}
}
},
"Prometheus": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -110,6 +133,12 @@
},
"pull": {
"$ref": "#/$defs/PullMetricReader"
},
"producers": {
dashpole marked this conversation as resolved.
Show resolved Hide resolved
"type": "array",
"items": {
"$ref": "#/$defs/MetricProducer"
}
}
}
},
Expand Down
Loading