Skip to content

Metrics service

/metrics exposes operational metrics of the pantahub-base process itself in Prometheus text format — Go runtime statistics (goroutines, heap, GC), process stats (CPU, memory, file descriptors) and scrape-handler counters. It exists for operators running their own Hub, not for devices or end users.

sh
curl -s https://api.pantahub.com/metrics/
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 11
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 1.9095552e+07

Point a Prometheus scrape job at it like any other Go service:

yaml
scrape_configs:
  - job_name: pantahub-base
    metrics_path: /metrics/
    static_configs:
      - targets: ["base:12365"]

Don't confuse this with the metrics scope of the apps service, which guards user-level metric resources.

Endpoint reference

EndpointReference
GET /metricsPrometheus metrics