sendit exposes a Prometheus scrape endpoint when metrics.enabled is true.

Enable metrics

metrics:
  enabled: true
  prometheus_port: 9090

Two endpoints are available on the configured port:

EndpointDescription
GET /metricsPrometheus scrape endpoint
GET /healthzLiveness probe — always returns 200 {"status":"ok"}

Useful for container health checks:

curl http://localhost:9090/healthz
# {"status":"ok"}

Metric reference

MetricTypeLabelsDescription
sendit_requests_totalCountertype, domain, status_codeTotal requests dispatched, by driver type, domain, and status code
sendit_errors_totalCountertype, domain, error_classTotal errors, by driver type, domain, and error class
sendit_request_duration_secondsHistogramtype, domainRequest latency distribution, by driver type and domain
sendit_bytes_read_totalCountertypeTotal bytes received, by driver type

Breaking change (v0.8.0): sendit_requests_total, sendit_errors_total, and sendit_request_duration_seconds gained a domain label. Update any existing dashboards or alert rules that match these metrics by label set.

Label values

type matches the type field in your target config: http, browser, dns, websocket, or grpc.

domain is the hostname extracted from the target URL (e.g. example.com, api.example.com). For DNS targets with bare hostnames the value is the hostname itself.

status_code is the HTTP status code (e.g. 200, 429, 503) or the DNS-mapped equivalent (see Drivers — DNS).

error_class is one of:

  • transient — errors that trigger backoff and retry (e.g. HTTP 429/503, DNS SERVFAIL, network failures)
  • permanent — errors that are logged and skipped with no retry (e.g. HTTP 404, DNS NXDOMAIN)

Scrape config example

# prometheus.yml
scrape_configs:
  - job_name: "sendit"
    static_configs:
      - targets: ["localhost:9090"]

No-op mode

When metrics.enabled: false (the default), sendit uses a no-op metrics implementation internally — there are no nil pointer checks and no Prometheus HTTP listener is started.