Skip to content

Monitoring

Greenlight provides Prometheus metrics to monitor the status of your healthchecks.

Scraping /metrics returns the metrics for every zone you are authorized for. To narrow that to particular zones, repeat the zone query parameter: /metrics?zone=<your zone>&zone=<another zone>.

Every series is labelled with the zone it belongs to. Series about a single name also have a name label, and series about a single healthcheck additionally have a check describing what it does and an id distinguishing checks that share a check value within a single name.

More metrics will be added over time.

Name Description
greenlightd_engine_check_up represents whether a healthcheck/boolean functions is up (value 1) or down (value 0)
greenlightd_engine_earliest_cert_expiry for TLS-enabled connections, returns unixtime in seconds of when the next certificate in the certificate chain will expire
greenlightd_engine_zone_names number of names currently registered in the zone
greenlightd_engine_name_records number of resource records configured on the name
greenlightd_engine_name_checks number of healthchecks currently registered on the name

Anything coarser aggregates from these. The number of zones you have, for example, is count(greenlightd_engine_zone_names), and your total number of names is sum(greenlightd_engine_zone_names).

Greenlight also records metrics about its own health, such as how much work is queued internally. Those describe the whole installation rather than any one zone, so they are not exposed here.

Authentication is required to access your metrics.

When you’re logged in to Greenlight’s web interface, you will be able to view them there at your Zone’s overview page (click on your Zones at /ui/zones).

To actually monitor your metrics from a monitoring system like Prometheus, VictoriaMetrics, or similar, you’ll want to use a Bearer token.

To do that:

  1. Create an API token at your dashboard. Note the token that gets shown to you; it will not be shown again.

  2. Configure your monitoring system to monitor your zone with the token. For example, for Prometheus:

    scrape_configs:
    - job_name: "your_zone"
    metrics_path: /metrics
    params:
    zone: ["<your zone>"]
    scheme: https
    static_configs:
    - targets: ["www.greenlightedns.net"]
    # http_config section
    # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_config
    authorization:
    type: "Bearer:"
    credentials: <your API token>
    # credentials_file: