-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprometheus.yml
93 lines (86 loc) · 2.72 KB
/
prometheus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# my global config
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
cluster: 'cluster01'
replica: 'r1'
scrape_configs:
# Self monitoring
# Node exporter
- job_name: 'nodeexporter'
scrape_interval: 5s
static_configs:
- targets: ['node-exporter:9100']
# cAdvisor
- job_name: 'cadvisor'
scrape_interval: 5s
static_configs:
- targets: ['cadvisor:8080']
# Prometheus
- job_name: prometheus
honor_timestamps: true
scrape_interval: 5s
scrape_timeout: 3s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- prometheus-server:9090
# Zipkin
- job_name: 'zipkin'
scrape_interval: 5s
metrics_path: '/prometheus'
static_configs:
- targets: ['zipkin:9411']
metric_relabel_configs:
# Response code count
- source_labels: [__name__]
regex: '^status_(\d+)_(.*)$'
replacement: '${1}'
target_label: status
- source_labels: [__name__]
regex: '^status_(\d+)_(.*)$'
replacement: '${2}'
target_label: path
- source_labels: [__name__]
regex: '^status_(\d+)_(.*)$'
replacement: 'http_requests_total'
target_label: __name__
# Jaeger
- job_name: 'jaeger'
scrape_interval: 5s
static_configs:
- targets: ['jaeger:14269']
# Spring petclinic services monitoring
# You can use Eureka's application instance metadata.
# If you are using SpringBoot, you can add metadata using eureka.instance.metadataMap like this:
# application.yaml (spring-boot)
# eureka:
# instance:
# metadataMap:
# "prometheus.scrape": "true"
# "prometheus.path": "/actuator/prometheus"
- job_name: eureka-discovery
metrics_path: /actuator/prometheus
scrape_interval: 15s
scrape_timeout: 15s
eureka_sd_configs:
- server: http://discovery-server:8761/eureka
refresh_interval: 30s
relabel_configs:
# Relabel to customize metric path based on application
# "prometheus.path = <metric path>" annotation.
- source_labels: [__address__, __meta_eureka_app_instance_metadata_prometheus_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
# Relabel to scrape only application that have
# "prometheus.scrape = true" metadata.
- source_labels: [__meta_eureka_app_instance_metadata_prometheus_scrape]
action: keep
regex: true