-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kube-prom-stack exporters (#1284)
* Add exporters * bump chart version * v bump
- Loading branch information
1 parent
70af5de
commit 144d15a
Showing
40 changed files
with
2,490 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
charts/opentelemetry-kube-stack/examples/targetallocator-prom/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Prometheus Replacement example | ||
This example contains files to allow a user to replace an installation of kube-prometheus-stack. The opentelemetry-kube-stack chart aims to make the replacement process straightforward by utilizing the target allocator to pull any servicemonitors and podmonitors. | ||
|
||
> [!INFO] | ||
> This chart has most of the same configurations as the kube-prometheus-stack chart, but requires that kubelet monitoring is done via a manual scrape config. This is because of how the prometheus-operator manages endpoints for the Kubelet service. If you'd like to avoid a scrape-config altogether, it's recommended to use the kubelet receiver in the opentelemetry collector. |
244 changes: 244 additions & 0 deletions
244
charts/opentelemetry-kube-stack/examples/targetallocator-prom/kubelet_scrape_configs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
# This is used for scrape kubelet | ||
{{- if .kubelet.enabled }} | ||
- authorization: | ||
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" | ||
type: Bearer | ||
follow_redirects: true | ||
honor_labels: {{ .kubelet.serviceMonitor.honorLabels }} | ||
honor_timestamps: {{ .kubelet.serviceMonitor.honorTimestamps }} | ||
job_name: serviceMonitor/{{ .namespace }}/{{ .Chart.Name }}-kubelet/0 | ||
kubernetes_sd_configs: | ||
- follow_redirects: true | ||
kubeconfig_file: '' | ||
role: node | ||
metrics_path: "/metrics" | ||
relabel_configs: | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- job | ||
target_label: __tmp_prometheus_job_name | ||
- action: replace | ||
replacement: "kubelet" | ||
target_label: job | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "${1}" | ||
separator: ";" | ||
source_labels: | ||
- __meta_kubernetes_node_name | ||
target_label: node | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: https-metrics | ||
separator: ";" | ||
target_label: endpoint | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __metrics_path__ | ||
target_label: metrics_path | ||
- action: hashmod | ||
modulus: 1 | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __address__ | ||
target_label: __tmp_hash | ||
- action: keep | ||
regex: "$(SHARD)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __tmp_hash | ||
{{- if .kubelet.serviceMonitor.https }} | ||
scheme: https | ||
{{- else }} | ||
schema: http | ||
{{- end }} | ||
scrape_interval: {{ .kubelet.serviceMonitor.interval | default "30s" }} | ||
scrape_timeout: {{ .kubelet.serviceMonitor.scrapeTimeout | default "10s" }} | ||
tls_config: | ||
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | ||
insecure_skip_verify: true | ||
{{- if .kubelet.serviceMonitor.cAdvisor }} | ||
- authorization: | ||
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" | ||
type: Bearer | ||
follow_redirects: true | ||
honor_labels: true | ||
honor_timestamps: true | ||
job_name: serviceMonitor/{{ .namespace }}/{{ .Chart.Name }}-kubelet/1 | ||
kubernetes_sd_configs: | ||
- follow_redirects: true | ||
kubeconfig_file: '' | ||
role: node | ||
metric_relabel_configs: | ||
- action: drop | ||
regex: container_cpu_(cfs_throttled_seconds_total|load_average_10s|system_seconds_total|user_seconds_total) | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __name__ | ||
- action: drop | ||
regex: container_fs_(io_current|io_time_seconds_total|io_time_weighted_seconds_total|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total) | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __name__ | ||
- action: drop | ||
regex: container_memory_(mapped_file|swap) | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __name__ | ||
- action: drop | ||
regex: container_(file_descriptors|tasks_state|threads_max) | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __name__ | ||
- action: drop | ||
regex: container_spec.* | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __name__ | ||
- action: drop | ||
regex: ".+;" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- id | ||
- pod | ||
metrics_path: "/metrics/cadvisor" | ||
relabel_configs: | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- job | ||
target_label: __tmp_prometheus_job_name | ||
- action: replace | ||
replacement: "kubelet" | ||
target_label: job | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "${1}" | ||
separator: ";" | ||
source_labels: | ||
- __meta_kubernetes_node_name | ||
target_label: node | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: https-metrics | ||
separator: ";" | ||
target_label: endpoint | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __metrics_path__ | ||
target_label: metrics_path | ||
- action: hashmod | ||
modulus: 1 | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __address__ | ||
target_label: __tmp_hash | ||
- action: keep | ||
regex: "$(SHARD)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __tmp_hash | ||
{{- if .kubelet.serviceMonitor.https }} | ||
scheme: https | ||
{{- else }} | ||
schema: http | ||
{{- end }} | ||
scrape_interval: {{ .kubelet.serviceMonitor.scrapeTimeout | default "30s" }} | ||
scrape_timeout: 10s | ||
tls_config: | ||
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | ||
insecure_skip_verify: true | ||
|
||
{{- end }} | ||
{{- if .kubelet.serviceMonitor.probes }} | ||
- authorization: | ||
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" | ||
type: Bearer | ||
follow_redirects: true | ||
honor_labels: true | ||
honor_timestamps: true | ||
job_name: serviceMonitor/{{ .namespace }}/{{ .Chart.Name }}-kubelet/2 | ||
kubernetes_sd_configs: | ||
- follow_redirects: true | ||
kubeconfig_file: '' | ||
role: node | ||
metrics_path: "/metrics/probes" | ||
relabel_configs: | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- job | ||
target_label: __tmp_prometheus_job_name | ||
- action: replace | ||
replacement: "kubelet" | ||
target_label: job | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "${1}" | ||
separator: ";" | ||
source_labels: | ||
- __meta_kubernetes_node_name | ||
target_label: node | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: https-metrics | ||
separator: ";" | ||
target_label: endpoint | ||
- action: replace | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __metrics_path__ | ||
target_label: metrics_path | ||
- action: hashmod | ||
modulus: 1 | ||
regex: "(.*)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __address__ | ||
target_label: __tmp_hash | ||
- action: keep | ||
regex: "$(SHARD)" | ||
replacement: "$1" | ||
separator: ";" | ||
source_labels: | ||
- __tmp_hash | ||
{{- if .kubelet.serviceMonitor.https }} | ||
scheme: https | ||
{{- else }} | ||
schema: http | ||
{{- end }} | ||
scrape_interval: {{ .kubelet.serviceMonitor.scrapeTimeout | default "30s" }} | ||
scrape_timeout: 10s | ||
tls_config: | ||
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | ||
insecure_skip_verify: true | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.