This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor rootfs/dockerswarm/dockerswarm-services.yml -> rootfs/docker…
…swarm/dockerswarm-endpoints-nodeport.yml
- Loading branch information
1 parent
9d3fcf1
commit a5e9b35
Showing
3 changed files
with
146 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# The scrape config for probing services via the Blackbox Exporter. | ||
# | ||
# The relabeling allows the actual service scrape endpoint to be configured | ||
# for all or only some services. | ||
# | ||
# Annotations: | ||
# io.prometheus.probe_enabled=<true|false> | ||
# io.prometheus.probe_disabled=<true|false> | ||
# | ||
# io.prometheus.dockerswarm-endpoints.should_be_probed=<true|false> | ||
scrape_configs: | ||
|
||
- job_name: 'dockerswarm-endpoints-ingresses' | ||
scrape_interval: 15s | ||
|
||
metrics_path: /probe | ||
params: | ||
module: [icmp_ttl5] | ||
|
||
dockerswarm_sd_configs: | ||
- host: unix:///var/run/docker.sock | ||
role: services | ||
refresh_interval: 10s | ||
|
||
relabel_configs: | ||
# ================================================================================ | ||
# Keep or drop targets with the following rules | ||
# ================================================================================ | ||
|
||
# io.prometheus.dockerswarm-endpoints.should_be_probed=<true|false> | ||
- source_labels: | ||
- __meta_dockerswarm_service_label_io_prometheus_dockerswarm_endpoints_should_be_probed | ||
regex: 'false' | ||
action: drop | ||
|
||
# io.prometheus.probe_enabled=<true|false> | ||
- source_labels: | ||
- __meta_dockerswarm_service_label_io_prometheus_probe_enabled | ||
regex: 'false' | ||
action: drop | ||
# io.prometheus.probe_disabled=<true|false> | ||
- source_labels: | ||
- __meta_dockerswarm_service_label_io_prometheus_probe_disabled | ||
regex: 'false' | ||
action: drop | ||
|
||
# Keep only tasks connected to the "host" network | ||
- source_labels: | ||
- __meta_dockerswarm_network_ingress | ||
regex: 'true' | ||
action: keep | ||
- source_labels: | ||
- __meta_dockerswarm_service_endpoint_port_publish_mode | ||
regex: 'ingress' | ||
action: keep | ||
|
||
# ================================================================================ | ||
# Override prometheus and blackbox internal labels | ||
# ================================================================================ | ||
- source_labels: | ||
- __address__ | ||
target_label: __tmp_target | ||
regex: ([^:]+)(?::\d+)? | ||
replacement: $1 | ||
- source_labels: [__address__] | ||
target_label: __tmp_address | ||
- source_labels: [__tmp_target] | ||
target_label: __param_target | ||
- target_label: __address__ | ||
replacement: blackbox-exporter.svc.cluster.local:9115 | ||
- source_labels: [__tmp_address] | ||
target_label: instance | ||
|
||
# Drop all labels starting with "io.prometheus." | ||
- action: labeldrop | ||
regex: __meta_(dockerswarm_service_label_io_prometheus_.+) | ||
|
||
# ================================================================================ | ||
# Label mapping | ||
# ================================================================================ | ||
- action: labelmap | ||
regex: __meta_(dockerswarm_.+) | ||
|
||
# ================================================================================ | ||
# Kubernetes compatible relabeling | ||
# - namespace | ||
# - deployment | ||
# - pod | ||
# ================================================================================ | ||
# Set Kubernetes's Namespace with "com.docker.stack.namespace" label | ||
- source_labels: | ||
- __meta_dockerswarm_service_label_com_docker_stack_namespace | ||
target_label: namespace | ||
|
||
# Set Kubernetes's Deployment with "com.docker.stack.namespace" label | ||
- source_labels: | ||
- __meta_dockerswarm_service_label_com_docker_stack_namespace | ||
target_label: deployment | ||
|
||
# Set Kubernetes' Service Name with Docker Swarm's Service Name | ||
- source_labels: | ||
- __meta_dockerswarm_service_name | ||
target_label: service | ||
separator: '.' | ||
|
||
# Set Kubernetes's Pod Name with Docker Swarm's Service Name | ||
- source_labels: | ||
- __meta_dockerswarm_service_name | ||
target_label: pod | ||
separator: '.' |
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