Failed to fetch

Quick Start

  1. Add targets to generator
  2. Configure Settings and Probes
  3. Download config via Download button
  4. Edit config to insert your auth, when not already logged in
  5. Run Quick Start Dashboard:
docker run -p 3000:3000 -p 9090:9090 \
  -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
  latencyat/dashboard

Access Grafana on http://localhost:3000 and Prometheus on http://localhost:9090.

Or run the official Prometheus image, without Grafana dashboards:

docker run -p 9090:9090 \
  -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
  prom/prometheus

Configuration

The Probes are HTTP services that provide Prometheus metrics about a given target. They are reachable via HTTP and HTTPS under this name:

https://<region>.<provider>.mon.latency.at
http://<region>.<provider>.mon.latency.at:8080

To request metrics from the Probes, the following header must be set:

Authorization: Bearer Your-Token

Prometheus does that for you when setting the bearer_token config option. You can create and revoke tokens in the Dashboard.

A minimal scrape config might look like this:

  - job_name: 'latency-at-simple'
    bearer_token: 'your-auth-token'
    metrics_path: /probe
    params:
      module: [http_2xx]
      target: [latency.at]
    static_configs:
      - targets:
        - https://fra1.do.mon.latency.at

Since duplicating this for every site and exporter can get tedious, it's recommended to use relabeling to generate the necessary configuration from a simple list of targets in the format site@region.provider.

You can also get metrics about your account by scraping https://api.latency.at/api/metrics with your token like this:

  - job_name: 'latency-at-account'
    bearer_token: 'your-auth-token'
    scheme: https
    metrics_path: /api/metrics
    static_configs:
      - targets:
        - api.latency.at

This give you the following metrics:

lat_account_available_requests: Remaining requests for this month

lat_plan_renewal_timestamp_seconds: UNIX timestamp of next plan renewal

lat_plan_requests: In plan included number of requests

You can use the following configuration generator. Add the targets you want to monitor to the module you want to use. If you want to send a HTTP GET request and expect a 2xx response, enter the target in the http_2xx field. After that you can download the generated configuration.

Targets

http_2xx
Sends GET, expects 2xx
http_post_2xx
Sends POST, expects 2xx
tcp_connect
Connects via TCP, expects established connection
pop3s_banner
Connects via TCP+TLS, expects "^+OK" response
ssh_banner
Connects via TCP, expects "^SSH-2.0- response
icmp
Sends ICMP echo request (ping), expects response

Scrape interval in seconds

+-

Probes

DigitalOcean

Result

This configuration sends about 438000 requests per month (10/min). You need at least the "Starter" plan to run this on one Prometheus server 24/7.

global:
  scrape_interval: 30s

scrape_configs:
  ### Sends GET, expects 2xx ###
  - job_name: 'latency-at-http_2xx'
    bearer_token: 'your-auth-token'
    metrics_path: /probe
    params:
      module: [http_2xx]
    static_configs:
      - targets:
        - https://latency.at@sfo1.do
        - https://latency.at@nyc1.do
        - https://latency.at@fra1.do
        - https://latency.at@blr1.do
        - https://latency.at@sgp1.do
    relabel_configs: &relabel_config
      - source_labels: [__address__]
        regex: (.*)@(.*)(:80)?
        target_label: __param_target
        replacement: ${1}
      - source_labels: [__param_target]
        regex: (.*)
        target_label: instance
        replacement: ${1}
      - source_labels: [__address__]
        regex: .*@([^.]*).*
        target_label: region
        replacement: ${1}
      - source_labels: [__address__]
        regex: .*@[^.]*.(.*)
        target_label: provider
        replacement: ${1}
      - source_labels: [region,provider]
        separator: .
        regex: (.*)
        target_label: __address__
        replacement: ${1}.mon.latency.at
      - source_labels: []
        target_label: __scheme__
        replacement: https

  ### Account metrics
  - job_name: 'latency-at-account'
    bearer_token: 'your-auth-token'
    scheme: https
    metrics_path: /api/metrics
    static_configs:
      - targets:
        - api.latency.at