Skip to content

Commit

Permalink
Add scrape_protocols to prometheus.scrape Components for Native H…
Browse files Browse the repository at this point in the history
…istograms (#932)
  • Loading branch information
SeamusGrafana authored Nov 22, 2024
1 parent aa765dd commit 676f935
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ prometheus.scrape "alloy" {
targets = discovery.relabel.alloy.output
scrape_interval = {{ .Values.metrics.alloy.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
forward_to = [prometheus.relabel.alloy.receiver]
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ prometheus.scrape "annotation_autodiscovery_http" {
{{- if .Values.metrics.autoDiscover.bearerToken.enabled }}
bearer_token_file = "/var/run/secrets/kubernetes.io/serviceaccount/token"
{{- end }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand All @@ -199,6 +203,10 @@ prometheus.scrape "annotation_autodiscovery_https" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ prometheus.scrape "apiserver" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
8 changes: 8 additions & 0 deletions charts/k8s-monitoring-v1/templates/alloy_config/_beyla.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ prometheus.scrape "beyla_applications" {
targets = discovery.relabel.beyla.output
honor_labels = true
scrape_interval = {{ .Values.metrics.beyla.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand All @@ -40,6 +44,10 @@ prometheus.scrape "beyla_internal" {
job_name = "integrations/beyla"
honor_labels = true
scrape_interval = {{ .Values.metrics.beyla.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ prometheus.scrape "cadvisor" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
4 changes: 4 additions & 0 deletions charts/k8s-monitoring-v1/templates/alloy_config/_kepler.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ prometheus.scrape "kepler" {
job_name = "integrations/kepler"
honor_labels = true
scrape_interval = {{ .Values.metrics.kepler.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ prometheus.scrape "kube_controller_manager" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ prometheus.scrape "kube_proxy" {
targets = discovery.relabel.kube_proxy.output
scheme = "http"
scrape_interval = {{ .Values.metrics.kubeProxy.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ prometheus.scrape "kube_scheduler" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ prometheus.scrape "kube_state_metrics" {
job_name = "integrations/kubernetes/kube-state-metrics"
targets = discovery.relabel.kube_state_metrics.output
scrape_interval = {{ (index .Values.metrics "kube-state-metrics").scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ prometheus.scrape "kubelet" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ prometheus.scrape "kubelet_resource" {
tls_config {
insecure_skip_verify = true
}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ prometheus.scrape "kubernetes_monitoring_telemetry" {
job_name = "integrations/kubernetes/kubernetes_monitoring_telemetry"
targets = discovery.relabel.kubernetes_monitoring_telemetry.output
scrape_interval = {{ .Values.metrics.kubernetesMonitoring.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ prometheus.scrape "node_exporter" {
job_name = "integrations/node_exporter"
targets = discovery.relabel.node_exporter.output
scrape_interval = {{ (index .Values.metrics "node-exporter").scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
4 changes: 4 additions & 0 deletions charts/k8s-monitoring-v1/templates/alloy_config/_opencost.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ prometheus.scrape "opencost" {
job_name = "integrations/kubernetes/opencost"
honor_labels = true
scrape_interval = {{ .Values.metrics.cost.scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ prometheus.scrape "windows_exporter" {
job_name = "integrations/windows-exporter"
targets = discovery.relabel.windows_exporter.output
scrape_interval = {{ (index .Values.metrics "windows-exporter").scrapeInterval | default .Values.metrics.scrapeInterval | quote }}
{{- if .Values.externalServices.prometheus.sendNativeHistograms }}
scrape_protocols = ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
scrape_classic_histograms = true
{{- end }}
{{- if .Values.alloy.alloy.clustering.enabled }}
clustering {
enabled = true
Expand Down

0 comments on commit 676f935

Please sign in to comment.