conf.good.yml 6.29 KB
Newer Older
1
# my global config
2
global:
3
4
5
6
  scrape_interval:     15s
  evaluation_interval: 30s
  # scrape_timeout is set to the global default (10s).

7
  external_labels:
8
9
    monitor: codelab
    foo:     bar
10
11

rule_files:
12
13
- "first.rules"
- "my/*.rules"
14

15
remote_write:
Julius Volz's avatar
Julius Volz committed
16
  - url: http://remote1/push
17
    name: drop_expensive
Julius Volz's avatar
Julius Volz committed
18
19
20
21
22
    write_relabel_configs:
    - source_labels: [__name__]
      regex:         expensive.*
      action:        drop
  - url: http://remote2/push
23
    name: rw_tls
24
25
26
    tls_config:
      cert_file: valid_cert_file
      key_file: valid_key_file
27
28
    headers:
      name: value
29

30
31
32
remote_read:
  - url: http://remote1/read
    read_recent: true
33
    name: default
34
35
  - url: http://remote3/read
    read_recent: false
36
    name: read_special
Tobias Schmidt's avatar
Tobias Schmidt committed
37
38
    required_matchers:
      job: special
39
40
41
    tls_config:
      cert_file: valid_cert_file
      key_file: valid_key_file
42

43
scrape_configs:
44
- job_name: prometheus
45

46
  honor_labels: true
47
48
  # scrape_interval is defined by the configured global (15s).
  # scrape_timeout is defined by the global default (10s).
49

50
51
  # metrics_path defaults to '/metrics'
  # scheme defaults to 'http'.
52

53
  file_sd_configs:
54
    - files:
55
56
57
58
      - foo/*.slow.json
      - foo/*.slow.yml
      - single/file.yml
      refresh_interval: 10m
59
    - files:
60
61
      - bar/*.yaml

62
  static_configs:
63
  - targets: ['localhost:9090', 'localhost:9191']
64
    labels:
65
66
67
68
      my:   label
      your: label

  relabel_configs:
69
  - source_labels: [job, __meta_dns_name]
70
    regex:         (.*)some-[regex]
71
72
73
    target_label:  job
    replacement:   foo-${1}
    # action defaults to 'replace'
74
75
76
77
  - source_labels: [abc]
    target_label:  cde
  - replacement:   static
    target_label:  abc
78
79
80
  - regex:
    replacement:   static
    target_label:  abc
81

82
83
  bearer_token_file: valid_token_file

84
85
86
87

- job_name: service-x

  basic_auth:
88
    username: admin_name
89
    password: "multiline\nmysecret\ntest"
90
91
92
93

  scrape_interval: 50s
  scrape_timeout:  5s

94
95
  sample_limit: 1000

96
97
98
99
100
101
102
103
104
105
106
107
108
109
  metrics_path: /my_path
  scheme: https

  dns_sd_configs:
  - refresh_interval: 15s
    names:
    - first.dns.address.domain.com
    - second.dns.address.domain.com
  - names:
    - first.dns.address.domain.com
    # refresh_interval defaults to 30s.

  relabel_configs:
  - source_labels: [job]
110
    regex:         (.*)some-[regex]
111
    action:        drop
Brian Brazil's avatar
Brian Brazil committed
112
113
  - source_labels: [__address__]
    modulus:       8
114
    target_label:  __tmp_hash
Brian Brazil's avatar
Brian Brazil committed
115
    action:        hashmod
116
  - source_labels: [__tmp_hash]
117
    regex:         1
Brian Brazil's avatar
Brian Brazil committed
118
    action:        keep
Matt Jibson's avatar
Matt Jibson committed
119
120
  - action:        labelmap
    regex:         1
121
122
123
124
  - action:        labeldrop
    regex:         d
  - action:        labelkeep
    regex:         k
125

126
127
  metric_relabel_configs:
  - source_labels: [__name__]
128
    regex:         expensive_metric.*
129
    action:        drop
130
131
132
133
134

- job_name: service-y

  consul_sd_configs:
  - server: 'localhost:1234'
Roman Vynar's avatar
Roman Vynar committed
135
    token: mysecret
136
    services: ['nginx', 'cache', 'mysql']
137
    tags: ["canary", "v1"]
138
139
140
    node_meta:
      rack: "123"
    allow_stale: true
141
142
143
144
145
146
    scheme: https
    tls_config:
      ca_file: valid_ca_file
      cert_file: valid_cert_file
      key_file:  valid_key_file
      insecure_skip_verify: false
147

148
149
  relabel_configs:
  - source_labels: [__meta_sd_consul_tags]
150
    separator:     ','
151
152
153
154
    regex:         label:([^=]+)=([^,]+)
    target_label:  ${1}
    replacement:   ${2}

155
156
- job_name: service-z

157
158
159
  tls_config:
    cert_file: valid_cert_file
    key_file: valid_key_file
160

161
  bearer_token: mysecret
Jimmi Dyson's avatar
Jimmi Dyson committed
162
163
164
165

- job_name: service-kubernetes

  kubernetes_sd_configs:
166
  - role: endpoints
Frederic Branczyk's avatar
Frederic Branczyk committed
167
    api_server: 'https://localhost:1234'
168
169
170
    tls_config:
      cert_file: valid_cert_file
      key_file: valid_key_file
171
172
173

    basic_auth:
      username: 'myusername'
174
      password: 'mysecret'
175

176
177
178
179
180
181
182
183
184
- job_name: service-kubernetes-namespaces

  kubernetes_sd_configs:
  - role: endpoints
    api_server: 'https://localhost:1234'
    namespaces:
      names:
        - default

185
186
187
188
189
  basic_auth:
    username: 'myusername'
    password_file: valid_password_file


190
191
192
- job_name: service-marathon
  marathon_sd_configs:
  - servers:
bekbulatov's avatar
bekbulatov committed
193
194
    - 'https://marathon.example.com:443'

195
    auth_token: "mysecret"
bekbulatov's avatar
bekbulatov committed
196
197
198
    tls_config:
      cert_file: valid_cert_file
      key_file: valid_key_file
Matt Jibson's avatar
Matt Jibson committed
199
200
201
202
203

- job_name: service-ec2
  ec2_sd_configs:
    - region: us-east-1
      access_key: access
204
      secret_key: mysecret
205
      profile: profile
206
207
208
209
210
211
212
213
214
      filters:
        - name: tag:environment
          values:
            - prod

        - name: tag:service
          values:
            - web
            - db
215

Seth Miller's avatar
Seth Miller committed
216
217
- job_name: service-azure
  azure_sd_configs:
218
    - environment: AzurePublicCloud
219
      authentication_method: OAuth
220
      subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11
Seth Miller's avatar
Seth Miller committed
221
222
      tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2
      client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C
223
      client_secret: mysecret
Seth Miller's avatar
Seth Miller committed
224
225
      port: 9100

226
227
228
229
230
231
- job_name: service-nerve
  nerve_sd_configs:
    - servers:
      - localhost
      paths:
      - /monitoring
232
233
234
235
236
237
238

- job_name: 0123service-xxx
  metrics_path: /metrics
  static_configs:
    - targets:
      - localhost:9090

Julien Pivotto's avatar
Julien Pivotto committed
239
240
241
242
243
244
245
- job_name: badfederation
  honor_timestamps: false
  metrics_path: /federate
  static_configs:
    - targets:
      - localhost:9090

246
247
248
249
250
- job_name: 測試
  metrics_path: /metrics
  static_configs:
    - targets:
      - localhost:9090
251

Richard Kiene's avatar
Richard Kiene committed
252
253
254
255
256
257
258
259
260
- job_name: service-triton
  triton_sd_configs:
  - account: 'testAccount'
    dns_suffix: 'triton.example.com'
    endpoint: 'triton.example.com'
    port: 9163
    refresh_interval: 1m
    version: 1
    tls_config:
261
262
      cert_file: valid_cert_file
      key_file: valid_key_file
Richard Kiene's avatar
Richard Kiene committed
263

Julien Pivotto's avatar
Julien Pivotto committed
264
265
266
267
- job_name: digitalocean-droplets
  digitalocean_sd_configs:
    - bearer_token: abcdef

Julien Pivotto's avatar
Julien Pivotto committed
268
269
270
271
272
- job_name: dockerswarm
  dockerswarm_sd_configs:
  - host: http://127.0.0.1:2375
    role: nodes

273
274
275
276
277
278
279
280
281
282
283
- job_name: service-openstack
  openstack_sd_configs:
  - role: instance
    region: RegionOne
    port: 80
    refresh_interval: 1m
    tls_config:
      ca_file: valid_ca_file
      cert_file: valid_cert_file
      key_file:  valid_key_file

284
285
286
287
288
289
290
291
292
- job_name: hetzner
  hetzner_sd_configs:
    - role: hcloud
      bearer_token: abcdef
    - role: robot
      basic_auth:
        username: abcdef
        password: abcdef

kangwoo's avatar
kangwoo committed
293
294
295
296
- job_name: service-eureka
  eureka_sd_configs:
    - server: 'http://eureka.example.com:8761/eureka'

297
298
299
300
301
302
303
304
alerting:
  alertmanagers:
  - scheme: https
    static_configs:
    - targets:
      - "1.2.3.4:9093"
      - "1.2.3.5:9093"
      - "1.2.3.6:9093"