Skip to content

Instantly share code, notes, and snippets.

@haidlir
Last active November 22, 2018 15:05
Show Gist options
  • Save haidlir/2b75e26b8de66f305ba43cc059ce315d to your computer and use it in GitHub Desktop.
Save haidlir/2b75e26b8de66f305ba43cc059ce315d to your computer and use it in GitHub Desktop.
API Monitoring - Prometheus
scrape_configs:
- job_name: 'exporter-001-get'
scrape_interval: 1m
metrics_path: /probe
params:
module: [http-2xx-get-token-9f057]
static_configs:
- targets:
- http://api.startup-example.id/v1/profiles/me
- http://api.startup-example.id/v1/profiles/board
- http://api.startup-example.id/v1/coin/draw
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: exporter-001:9115
- job_name: 'exporter-001-post'
scrape_interval: 1m
metrics_path: /probe
params:
module: [http-2xx-post-token-9f057] # Look for a HTTP 200 response.
static_configs:
- targets:
- http://api.startup-example.id/v1/test
- http://api.startup-example.id/v1/voucher/claim
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: exporter-001:9115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment