Open creativie opened 3 months ago
Hi
It would be very convenient to use a custom CRD to fill the configuration with rules.
For example, two "PrometheusAdapterRule" CRDs
apiVersion: monitoring.coreos.com/v1alpha1 kind: PrometheusAdapterRule metadata: name: example-1 spec: rules: - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}' resources: overrides: namespace: {resource: "namespace"} pod: {resource: "pod"} name: matches: "^container_(.*)_seconds_total$" metricsQuery: "sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[2m])) by (<<.GroupBy>>)"
and
apiVersion: monitoring.coreos.com/v1alpha1 kind: PrometheusAdapterRule metadata: name: example-2 spec: rules: - seriesQuery: 'cheddar{sharp="true"}' name: {as: "cheesy_goodness"} resources: overrides: brand: {group: "cheese.io", resource: "brand"} metricsQuery: 'count(cheddar{sharp="true"})'
generates configuration file for Prometheus Adapter like this
rules: # example-1 - seriesQuery: '{__name__=~"^container_.*",container!="POD",namespace!="",pod!=""}' resources: overrides: namespace: {resource: "namespace"} pod: {resource: "pod"} name: matches: "^container_(.*)_seconds_total$" metricsQuery: "sum(rate(<<.Series>>{<<.LabelMatchers>>,container!="POD"}[2m])) by (<<.GroupBy>>)" # example-2 - seriesQuery: 'cheddar{sharp="true"}' name: {as: "cheesy_goodness"} resources: overrides: brand: {group: "cheese.io", resource: "brand"} metricsQuery: 'count(cheddar{sharp="true"})'
/assign /triage accepted
/triage accepted
Hi
It would be very convenient to use a custom CRD to fill the configuration with rules.
For example, two "PrometheusAdapterRule" CRDs
and
generates configuration file for Prometheus Adapter like this