Skip to content

Instantly share code, notes, and snippets.

@skreuzer
Last active February 7, 2019 18:45
Show Gist options
  • Save skreuzer/0925628cbaabc1766e9e2d6650cf47e5 to your computer and use it in GitHub Desktop.
Save skreuzer/0925628cbaabc1766e9e2d6650cf47e5 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