Skip to content

Instantly share code, notes, and snippets.

@bdmorin
Forked from skreuzer/prometheus.yml
Created June 15, 2018 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdmorin/2cf465c50516a31593ff634bcdced6da to your computer and use it in GitHub Desktop.
Save bdmorin/2cf465c50516a31593ff634bcdced6da to your computer and use it in GitHub Desktop.
smokeping style metrics in prometheus
global:
evaluation_interval: 15s
rule_files:
- smokeping.rules
scrape_configs:
- job_name: 'blackbox_icmp'
metrics_path: /probe
params:
module: [icmp]
scrape_interval: 1s
static_configs:
- targets:
- ...
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115 # Blackbox exporter.
groups:
- name: smokeping.rules
rules:
- record: job:probe_loss:avg15s
expr: 1 - avg_over_time(probe_success{job="blackbox_icmp"}[15s])
- record: job:probe_durration_seconds:min15s
expr: min_over_time(probe_duration_seconds{job="blackbox_icmp"}[15s])
- record: job:probe_durration_seconds:q25_15s
expr: quantile_over_time(0.25, probe_duration_seconds{job="blackbox_icmp"}[15s])
- record: job:probe_durration_seconds:q50_15s
expr: quantile_over_time(0.5, probe_duration_seconds{job="blackbox_icmp"}[15s])
- record: job:probe_durration_seconds:q75_15s
expr: quantile_over_time(0.75, probe_duration_seconds{job="blackbox_icmp"}[15s])
- record: job:probe_durration_seconds:max15s
expr: max_over_time(probe_duration_seconds{job="blackbox_icmp"}[15s])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment