cAdvisor scrape target for kubernetes v1.7+ #2700
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -684,6 +684,43 @@ serverFiles: | |
target_label: __metrics_path__ | ||
replacement: /api/v1/nodes/${1}/proxy/metrics | ||
|
||
|
||
- job_name: 'kubernetes-nodes-cadvisor' | ||
|
||
# Default to scraping over https. If required, just disable this or change to | ||
# `http`. | ||
scheme: https | ||
|
||
# This TLS & bearer token file config is used to connect to the actual scrape | ||
# endpoints for cluster components. This is separate to discovery auth | ||
# configuration because discovery & scraping are two separate concerns in | ||
# Prometheus. The discovery auth config is automatic if Prometheus runs inside | ||
# the cluster. Otherwise, more config options have to be provided within the | ||
# <kubernetes_sd_config>. | ||
tls_config: | ||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
# If your node certificates are self-signed or use a different CA to the | ||
# master CA, then disable certificate verification below. Note that | ||
# certificate verification is an integral part of a secure infrastructure | ||
# so this should only be disabled in a controlled environment. You can | ||
# disable certificate verification by uncommenting the line below. | ||
# | ||
insecure_skip_verify: true | ||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
|
||
kubernetes_sd_configs: | ||
- role: node | ||
|
||
relabel_configs: | ||
- action: labelmap | ||
regex: __meta_kubernetes_node_label_(.+) | ||
- target_label: __address__ | ||
replacement: kubernetes.default.svc:443 | ||
- source_labels: [__meta_kubernetes_node_name] | ||
regex: (.+) | ||
target_label: __metrics_path__ | ||
replacement: /api/v1/nodes/${1}:4194/proxy/metrics | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed here that you're using the endpoint for 1.7.0 - 1.7.2. According to the documentation added in prometheus/prometheus#2918, I believe that the configuration for 1.7.3+ should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output from
|
||
|
||
# Scrape config for service endpoints. | ||
# | ||
# The relabeling allows the actual service scrape endpoint to be configured | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some header comment here, why we need this.
Similar to https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L53 and https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L88