Prometheus Metrics

You can configure metrics support by adding the following to your config:

metrics:
  enabled: true
  bindAddress: 127.0.0.1
  port: 9002

Hookshot will then provide metrics on 127.0.0.1 at port 9002.

An example dashboard that can be used with Grafana can be found at /contrib/hookshot-dashboard.json. There are 3 variables at the top of the dashboard:

image

Select the Prometheus instance with your Hookshot metrics as Data Source. Set Interval to your scraping interval. Set 2x Interval to twice the Interval value (why?).

Below is the generated list of Prometheus metrics for Hookshot.

hookshot

MetricHelpLabels
hookshot_webhooks_http_requestNumber of requests made to the hookshot webhooks handlerpath, method
hookshot_provisioning_http_requestNumber of requests made to the hookshot provisioner handlerpath, method
hookshot_queue_event_pushesNumber of events pushed through the queueevent
hookshot_connection_event_failedNumber of events that failed to processevent, connectionId
hookshot_connectionsNumber of active hookshot connectionsservice
hookshot_notifications_pushNumber of notifications pushedservice
hookshot_notifications_service_upWhether the notification service is up or downservice
hookshot_notifications_watchersNumber of notifications watchers runningservice
hookshot_feeds_countNumber of RSS feeds that hookshot is subscribed to
hookshot_feeds_fetch_msTime taken for hookshot to fetch all feeds
hookshot_feeds_failingNumber of RSS feeds that hookshot is failing to readreason

matrix

MetricHelpLabels
matrix_api_callsNumber of Matrix client API calls mademethod
matrix_api_calls_failedNumber of Matrix client API calls which failedmethod
matrix_appservice_eventsNumber of events sent over the AS API
matrix_appservice_decryption_failedNumber of events sent over the AS API that failed to decrypt

feed

MetricHelpLabels
feed_count(Deprecated) Number of RSS feeds that hookshot is subscribed to
feed_fetch_ms(Deprecated) Time taken for hookshot to fetch all feeds
feed_failing(Deprecated) Number of RSS feeds that hookshot is failing to readreason

process

MetricHelpLabels
process_cpu_user_seconds_totalTotal user CPU time spent in seconds.
process_cpu_system_seconds_totalTotal system CPU time spent in seconds.
process_cpu_seconds_totalTotal user and system CPU time spent in seconds.
process_start_time_secondsStart time of the process since unix epoch in seconds.
process_resident_memory_bytesResident memory size in bytes.
process_virtual_memory_bytesVirtual memory size in bytes.
process_heap_bytesProcess heap size in bytes.
process_open_fdsNumber of open file descriptors.
process_max_fdsMaximum number of open file descriptors.

nodejs

MetricHelpLabels
nodejs_eventloop_lag_secondsLag of event loop in seconds.
nodejs_eventloop_lag_min_secondsThe minimum recorded event loop delay.
nodejs_eventloop_lag_max_secondsThe maximum recorded event loop delay.
nodejs_eventloop_lag_mean_secondsThe mean of the recorded event loop delays.
nodejs_eventloop_lag_stddev_secondsThe standard deviation of the recorded event loop delays.
nodejs_eventloop_lag_p50_secondsThe 50th percentile of the recorded event loop delays.
nodejs_eventloop_lag_p90_secondsThe 90th percentile of the recorded event loop delays.
nodejs_eventloop_lag_p99_secondsThe 99th percentile of the recorded event loop delays.
nodejs_active_resourcesNumber of active resources that are currently keeping the event loop alive, grouped by async resource type.type
nodejs_active_resources_totalTotal number of active resources.
nodejs_active_handlesNumber of active libuv handles grouped by handle type. Every handle type is C++ class name.type
nodejs_active_handles_totalTotal number of active handles.
nodejs_active_requestsNumber of active libuv requests grouped by request type. Every request type is C++ class name.type
nodejs_active_requests_totalTotal number of active requests.
nodejs_heap_size_total_bytesProcess heap size from Node.js in bytes.
nodejs_heap_size_used_bytesProcess heap size used from Node.js in bytes.
nodejs_external_memory_bytesNode.js external memory size in bytes.
nodejs_heap_space_size_total_bytesProcess heap space size total from Node.js in bytes.space
nodejs_heap_space_size_used_bytesProcess heap space size used from Node.js in bytes.space
nodejs_heap_space_size_available_bytesProcess heap space size available from Node.js in bytes.space
nodejs_version_infoNode.js version info.version, major, minor, patch
nodejs_gc_duration_secondsGarbage collection duration by kind, one of major, minor, incremental or weakcb.kind