Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
121 changes: 60 additions & 61 deletions config/prometheus/hack.prometheus.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,66 +351,65 @@ serverFiles:
# target_label: service


## DEVZERO COMMENTED OUT TO PREVENT SCRAPING
# # Example scrape config for pods
# #
# # The relabeling allows the actual pod scrape endpoint to be configured via the
# # following annotations:
# #
# # * `prometheus.io/scrape`: Only scrape pods that have a value of `true`,
# # except if `prometheus.io/scrape-slow` is set to `true` as well.
# # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
# # to set this to `https` & most likely set the `tls_config` of the scrape config.
# # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
# - job_name: 'kubernetes-pods'
# honor_labels: true
#
# kubernetes_sd_configs:
# - role: pod
#
# relabel_configs:
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape ]
# action: keep
# regex: true
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape_slow ]
# action: drop
# regex: true
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scheme ]
# action: replace
# regex: (https?)
# target_label: __scheme__
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_path ]
# action: replace
# target_label: __metrics_path__
# regex: (.+)
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_ip ]
# action: replace
# regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})
# replacement: '[$2]:$1'
# target_label: __address__
# - source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_ip ]
# action: replace
# regex: (\d+);((([0-9]+?)(\.|$)){4})
# replacement: $2:$1
# target_label: __address__
# - action: labelmap
# regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
# replacement: __param_$1
# - action: labelmap
# regex: __meta_kubernetes_pod_label_(.+)
# - source_labels: [ __meta_kubernetes_namespace ]
# action: replace
# target_label: namespace
# - source_labels: [ __meta_kubernetes_pod_name ]
# action: replace
# target_label: pod
# - source_labels: [ __meta_kubernetes_pod_phase ]
# regex: Pending|Succeeded|Failed|Completed
# action: drop
# - source_labels: [ __meta_kubernetes_pod_node_name ]
# action: replace
# target_label: node
# Example scrape config for pods
#
# The relabeling allows the actual pod scrape endpoint to be configured via the
# following annotations:
#
# * `prometheus.io/scrape`: Only scrape pods that have a value of `true`,
# except if `prometheus.io/scrape-slow` is set to `true` as well.
# * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
# to set this to `https` & most likely set the `tls_config` of the scrape config.
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
- job_name: 'kubernetes-pods'
honor_labels: true

kubernetes_sd_configs:
- role: pod

relabel_configs:
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape ]
action: keep
regex: true
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape_slow ]
action: drop
regex: true
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scheme ]
action: replace
regex: (https?)
target_label: __scheme__
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_path ]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_ip ]
action: replace
regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})
replacement: '[$2]:$1'
target_label: __address__
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_ip ]
action: replace
regex: (\d+);((([0-9]+?)(\.|$)){4})
replacement: $2:$1
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
replacement: __param_$1
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
action: replace
target_label: namespace
- source_labels: [ __meta_kubernetes_pod_name ]
action: replace
target_label: pod
- source_labels: [ __meta_kubernetes_pod_phase ]
regex: Pending|Succeeded|Failed|Completed
action: drop
- source_labels: [ __meta_kubernetes_pod_node_name ]
action: replace
target_label: node


## DEVZERO COMMENTED OUT TO PREVENT SCRAPING
Expand Down Expand Up @@ -472,4 +471,4 @@ serverFiles:
# action: drop
# - source_labels: [ __meta_kubernetes_pod_node_name ]
# action: replace
# target_label: node
# target_label: node
58 changes: 58 additions & 0 deletions dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,64 @@ data:
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- honor_labels: true
job_name: kubernetes-pods
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
- action: drop
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape_slow
- action: replace
regex: (https?)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scheme
target_label: __scheme__
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})
replacement: '[$2]:$1'
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_port
- __meta_kubernetes_pod_ip
target_label: __address__
- action: replace
regex: (\d+);((([0-9]+?)(\.|$)){4})
replacement: $2:$1
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_port
- __meta_kubernetes_pod_ip
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
replacement: __param_$1
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: namespace
- action: replace
source_labels:
- __meta_kubernetes_pod_name
target_label: pod
- action: drop
regex: Pending|Succeeded|Failed|Completed
source_labels:
- __meta_kubernetes_pod_phase
- action: replace
source_labels:
- __meta_kubernetes_pod_node_name
target_label: node
recording_rules.yml: |
{}
rules: |
Expand Down
58 changes: 58 additions & 0 deletions dist/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,64 @@ data:
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- honor_labels: true
job_name: kubernetes-pods
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: keep
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
- action: drop
regex: true
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scrape_slow
- action: replace
regex: (https?)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_scheme
target_label: __scheme__
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_path
target_label: __metrics_path__
- action: replace
regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})
replacement: '[$2]:$1'
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_port
- __meta_kubernetes_pod_ip
target_label: __address__
- action: replace
regex: (\d+);((([0-9]+?)(\.|$)){4})
replacement: $2:$1
source_labels:
- __meta_kubernetes_pod_annotation_prometheus_io_port
- __meta_kubernetes_pod_ip
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_annotation_prometheus_io_param_(.+)
replacement: __param_$1
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: namespace
- action: replace
source_labels:
- __meta_kubernetes_pod_name
target_label: pod
- action: drop
regex: Pending|Succeeded|Failed|Completed
source_labels:
- __meta_kubernetes_pod_phase
- action: replace
source_labels:
- __meta_kubernetes_pod_node_name
target_label: node
recording_rules.yml: |
{}
rules: |
Expand Down
Loading