Class: PgEventstore::Web::Metrics::Application

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/pg_eventstore/web/metrics/application.rb,
sig/pg_eventstore/web/metrics/application.rbs

Overview

Standalone rack application serving subscription metrics in the Prometheus text exposition format.

It ships without any authentication - how the endpoint is protected is up to the application mounting it, the same way it is for the Admin UI (see docs/admin_ui.md#authorization).

Which pg_eventstore database is queried is chosen per request with the "config" query param, so one mounted app can serve metrics of every configured store:

GET /subscriptions/latency?config=db1

An absent config means the default one; an unknown config is answered with 404 rather than silently served from the default store, so a misconfigured scrape shows up as a failing target instead of as wrong data. Add "set" params to report only some subscription sets - repeat the param for several: "?set=SetA&set=SetB".

Instance Method Summary collapse

Instance Method Details

#config_nameSymbol

Returns:

  • (Symbol)


7
# File 'sig/pg_eventstore/web/metrics/application.rbs', line 7

def config_name: -> Symbol

#metrics_connectionConnection

Returns:



5
# File 'sig/pg_eventstore/web/metrics/application.rbs', line 5

def metrics_connection: -> Connection