BigW Consortium Gitlab

Commit 0f449ecc by Kamil Trzciński

Merge branch '41796-update-auto-deployed-prometheus-scrape-config' into 'master'

Update auto-deployed prometheus scrape config Closes #41796 See merge request gitlab-org/gitlab-ce!16306
parents a7d17262 15e6278e
...@@ -18,138 +18,100 @@ serverFiles: ...@@ -18,138 +18,100 @@ serverFiles:
rule_files: rule_files:
- /etc/config/rules - /etc/config/rules
- /etc/config/alerts - /etc/config/alerts
scrape_configs: scrape_configs:
- job_name: prometheus - job_name: prometheus
static_configs: static_configs:
- targets: - targets:
- localhost:9090 - localhost:9090
- job_name: kubernetes-cadvisor
- job_name: 'kubernetes-apiservers'
kubernetes_sd_configs:
- role: endpoints
scheme: https scheme: https
tls_config: tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
insecure_skip_verify: true insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
kubernetes_sd_configs:
- role: node
api_server: https://kubernetes.default.svc:443
tls_config:
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
relabel_configs: relabel_configs:
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] - action: labelmap
action: keep regex: __meta_kubernetes_node_label_(.+)
regex: default;kubernetes;https - target_label: __address__
replacement: kubernetes.default.svc:443
- job_name: 'kubernetes-nodes' - source_labels:
- __meta_kubernetes_node_name
regex: "(.+)"
target_label: __metrics_path__
replacement: "/api/v1/nodes/${1}/proxy/metrics/cadvisor"
metric_relabel_configs:
- source_labels:
- pod_name
target_label: environment
regex: "(.+)-.+-.+"
- job_name: kubernetes-nodes
scheme: https scheme: https
tls_config: tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
insecure_skip_verify: true insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
kubernetes_sd_configs: kubernetes_sd_configs:
- role: node - role: node
api_server: https://kubernetes.default.svc:443
tls_config:
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
relabel_configs: relabel_configs:
- action: labelmap - action: labelmap
regex: __meta_kubernetes_node_label_(.+) regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__ - target_label: __address__
replacement: kubernetes.default.svc:443 replacement: kubernetes.default.svc:443
- source_labels: [__meta_kubernetes_node_name] - source_labels:
regex: (.+) - __meta_kubernetes_node_name
target_label: __metrics_path__ regex: "(.+)"
replacement: /api/v1/nodes/${1}/proxy/metrics target_label: __metrics_path__
- job_name: 'kubernetes-service-endpoints' replacement: "/api/v1/nodes/${1}/proxy/metrics"
metric_relabel_configs:
kubernetes_sd_configs: - source_labels:
- role: endpoints - pod_name
target_label: environment
relabel_configs: regex: "(.+)-.+-.+"
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] - job_name: kubernetes-pods
action: keep tls_config:
regex: true ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] insecure_skip_verify: true
action: replace bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
target_label: __scheme__
regex: (https?)
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
action: replace
target_label: __address__
regex: (.+)(?::\d+);(\d+)
replacement: $1:$2
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_service_name]
action: replace
target_label: kubernetes_name
- job_name: 'prometheus-pushgateway'
honor_labels: true
kubernetes_sd_configs:
- role: service
relabel_configs:
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
action: keep
regex: pushgateway
- job_name: 'kubernetes-services'
metrics_path: /probe
params:
module: [http_2xx]
kubernetes_sd_configs:
- role: service
relabel_configs:
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_probe]
action: keep
regex: true
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: blackbox
- source_labels: [__param_target]
target_label: instance
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_service_name]
target_label: kubernetes_name
- job_name: 'kubernetes-pods'
kubernetes_sd_configs: kubernetes_sd_configs:
- role: pod - role: pod
api_server: https://kubernetes.default.svc:443
tls_config:
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
relabel_configs: relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] - source_labels:
action: keep - __meta_kubernetes_pod_annotation_prometheus_io_scrape
regex: true action: keep
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] regex: 'true'
action: replace - source_labels:
target_label: __metrics_path__ - __meta_kubernetes_pod_annotation_prometheus_io_path
regex: (.+) action: replace
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] target_label: __metrics_path__
action: replace regex: "(.+)"
regex: (.+):(?:\d+);(\d+) - source_labels:
replacement: ${1}:${2} - __address__
target_label: __address__ - __meta_kubernetes_pod_annotation_prometheus_io_port
- action: labelmap action: replace
regex: __meta_kubernetes_pod_label_(.+) regex: "([^:]+)(?::[0-9]+)?;([0-9]+)"
- source_labels: [__meta_kubernetes_namespace] replacement: "$1:$2"
action: replace target_label: __address__
target_label: kubernetes_namespace - action: labelmap
- source_labels: [__meta_kubernetes_pod_name] regex: __meta_kubernetes_pod_label_(.+)
action: replace - source_labels:
target_label: kubernetes_pod_name - __meta_kubernetes_namespace
action: replace
target_label: kubernetes_namespace
- source_labels:
- __meta_kubernetes_pod_name
action: replace
target_label: kubernetes_pod_name
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment