ConfigurationΒΆ

nameko-prometheus is configured from YAML config file, as per nameko convention.

All configuration options for nameko-prometheus should be under the PROMETHEUS key. Metrics are configured on a per-service basis. (This is similar to what nameko-sqlalchemy does with DB_URIS).

For example if your project exposes two services like so:

class FooService:
    name = "foo_service"
    metrics = PrometheusMetrics()


class BarService:
    name = "bar_service"
    metrics = PrometheusMetrics()

Then to provide separate prefixes for metrics, add the following to your config file:

PROMETHEUS:
  foo_service:
    prefix: foo
  bar_service:
    prefix: bar