mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 05:04:05 -08:00
documentation - add marathon-sd example configuration
Signed-off-by: Timo Beckers <timo@incline.eu>
This commit is contained in:
parent
270c8760a3
commit
b12ed54f95
60
documentation/examples/prometheus-marathon.yml
Normal file
60
documentation/examples/prometheus-marathon.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
# A example scrape configuration for running Prometheus on a Marathon
|
||||
# (or DC/OS) cluster.
|
||||
|
||||
scrape_configs:
|
||||
|
||||
# Make Prometheus scrape itself for metrics.
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
# Discover Marathon services to scrape.
|
||||
- job_name: 'marathon'
|
||||
|
||||
# Scrape Marathon itself to discover new services every minute.
|
||||
marathon_sd_configs:
|
||||
- servers:
|
||||
- http://marathon.mesos:8080
|
||||
refresh_interval: 60s
|
||||
|
||||
relabel_configs:
|
||||
|
||||
# Only scrape targets that have a port label called 'metrics' specified on a port
|
||||
# in their app definitions. Example using a port mapping (container or bridge networking):
|
||||
#
|
||||
# "portMappings": [
|
||||
# {
|
||||
# "containerPort": 9091,
|
||||
# "name": "prometheus",
|
||||
# "labels": {
|
||||
# "metrics": "/metrics"
|
||||
# }
|
||||
# }
|
||||
# ]
|
||||
#
|
||||
# Or, in case your service uses host networking, using a port definition:
|
||||
#
|
||||
# "portDefinitions" : [
|
||||
# {
|
||||
# "port" : 9091,
|
||||
# "name" : "prometheus",
|
||||
# "labels": {
|
||||
# "metrics": "/metrics"
|
||||
# }
|
||||
# }
|
||||
# ]
|
||||
|
||||
# Match a slash-prefixed string either in a portMapping or a portDefinition label.
|
||||
- source_labels: [__meta_marathon_port_mapping_label_metrics,__meta_marathon_port_definition_label_metrics]
|
||||
regex: (\/.+;|;\/.+)
|
||||
action: keep
|
||||
|
||||
# If a portMapping 'metrics' label is set, use the label value as the URI to scrape.
|
||||
- source_labels: [__meta_marathon_port_mapping_label_metrics]
|
||||
regex: (\/.+)
|
||||
target_label: __metrics_path__
|
||||
|
||||
# If a portDefinition 'metrics' label is set, use the label value as the URI to scrape.
|
||||
- source_labels: [__meta_marathon_port_definition_label_metrics]
|
||||
regex: (\/.+)
|
||||
target_label: __metrics_path__
|
Loading…
Reference in a new issue