Skip to content

Commit

Permalink
chore: blackbox exporter scrape relabeling
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreiffers committed Jan 5, 2024
1 parent 1b6c99c commit d755f02
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 1 deletion.
87 changes: 87 additions & 0 deletions infrastructure/dev/monitoring/helm-release-blackbox-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: blackbox-exporter
namespace: flux-system
spec:
interval: 5m
targetNamespace: monitoring
chart:
spec:
version: 8.x
chart: prometheus-blackbox-exporter
sourceRef:
kind: HelmRepository
name: prometheus-community
interval: 60m
install:
crds: Create
upgrade:
crds: CreateReplace
values:
config:
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes:
- 200
- 204
follow_redirects: true
preferred_ip_protocol: "ip4"
scrape_configs:
- job_name: 'kubernetes-ingresses'

metrics_path: /probe
params:
module: [http_2xx]

kubernetes_sd_configs:
- role: ingress

relabel_configs:
- source_labels: [__meta_kubernetes_ingress_annotation_prometheus_io_probe]
action: keep
regex: true
- source_labels: [__address__]
regex: (.+);(.+)
replacement: https://${1}
target_label: __param_target
- source_labels: [__address__]
regex: (catalog-admin\..+)
replacement: https://${1}/api/ping
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- action: labelmap
regex: __meta_kubernetes_ingress_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_ingress_name]
target_label: kubernetes_name
serviceMonitor:
enabled: true
targets:
- name: datajegeren
url: https://datafabrikken.norge.no/finn-data/datajegeren

#
# TODO: TEST Probe
#
# kind: Probe
# apiVersion: monitoring.coreos.com/v1
# metadata:
# name: probes
# namespace: monitoring
# spec:
# interval: 60s
# module: http_2xx
# prober:
# url: monitoring-blackbox-exporter-prometheus-blackbox-exporter.monitoring.svc.cluster.local:9115
# targets:
# staticConfig:
# static:
# - https://google.com/
3 changes: 2 additions & 1 deletion infrastructure/dev/monitoring/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ kind: Kustomization
resources:
- ../../base/monitoring
- helm-release-elasticsearch-exporter.yaml
patchesStrategicMerge:
- helm-release-blackbox-exporter.yaml
patchesStrategicMerge:
- helm-release-kafka-exporter-values.yaml
- helm-release-prometheus-values.yaml
- helm-release-thanos-values.yaml
Expand Down

0 comments on commit d755f02

Please sign in to comment.