Collecting and Viewing Event Gateway Metrics

September 10, 2018 ยท View on GitHub

This guide details how to collect and analyze metrics from the Event Gateway.

Introduction

The Event Gateway exposes a number of Prometheus-based metrics + counters via the configuration API to help monitor the health of the gateway.

Contents

  1. Collecting Metrics
  2. Visualizing Data
    1. Prometheus
    2. InfluxDB
  3. List of Metrics
    1. Events API
    2. Configuration API

Collecting Metrics

Event Gateway metrics are exposed via a Prometheus text-based metric exporter and as such are queryable by a variety of modern toolsets. While you can scrape data directly from your prometheus database, the following (non-exhaustive) list of sources can also be configured to scrape Event Gateway metrics:

Visualizing Data

Included in the contrib folder are identical dashboards to visualize Event Gateway metrics with different data sources. Depending on your setup you'll find a Prometheus and InfluxDB version of the dashboard.

Importing a Grafana dashboard is relatively straightforward provided your datasources are configured properly within your Grafana instance. Each of our dashboards lists respective datasources as a template variable, assuming the default datasource is set to the type for your datasource; in other words, if you import the Prometheus dashboard the template will expect your default data source to be set to Prometheus.

If your default datasource is not either of the Prometheus or InfluxDB sources, fear not! The template variable is set as the datasource for each panel within the dashboard, so updating the datasource is as easy as choosing another option from the template dropdown.

NOTE: There are two dashboards included for each datasource: an aggregated dashboard for all spaces in a given Event Gateway deployment, and a second dashboard that can drill down to individual spaces.

Prometheus

You can find the source for the Prometheus dashboard here.

InfluxDB

You can find the source for the InfluxDB dashboard here.

List of Metrics

Both Events and Configuration API exposes Prometheus metrics. The metrics are accesible via /v1/metrics endpoint of Configuration API. The table below outlines the specific metrics available to query from the endpoint:

Events API

MetricTypeLabelsDescription
eventgateway_events_received_totalcounterspace, typetotal of events received
eventgateway_events_processed_totalcounterspace, typetotal of processed events
eventgateway_events_dropped_totalcounterspace, typetotal of events dropped due to insufficient processing power
eventgateway_events_backloggaugegauge of asynchronous events count waiting to be processed
eventgateway_events_custom_processing_secondshistogrambucketed histogram of processing duration of an event
(from receiving the async custom event to calling a function)

Labels

  • space - space name
  • type - event type name

Configuration API

MetricTypeLabelsDescription
eventgateway_eventtypes_totalgaugespacegauge of registered event types count
eventgateway_functions_totalgaugespacegauge of registered functions count
eventgateway_subscriptions_totalgaugespacegauge of created subscriptions count
eventgateway_config_requests_totalcounterspace, resource, operationtotal of Config API requests
eventgateway_config_request_duration_secondshistogrambucketed histogram of request duration of Config API requests

Labels

  • space - space name
  • resource - Configuration API resource, possible values: eventtype, function or subscription
  • operation - Configuration API operation, possible values: create, get, delete, list, update