Skip to content

Setup monitoring

Backend provides the following endpoints with Prometheus compatible metrics:

  • GET /monitoring/metrics - server metrics, like number of requests per path and response status, CPU and RAM usage, and so on.

These endpoints are enabled and configured using settings below:

MonitoringSettings

Monitoring Settings.

See starlette-exporter documentation.

Note

You can pass here any extra option supported by starlette-exporter, even if it is not mentioned in documentation.

Examples:

config.yml
server:
  monitoring:
    enabled: true
    skip_paths: [/some/path]
    skip_methods: [OPTIONS]

Parameters:

  • enabled

    (bool, default: True ) –

    Set to True to enable middleware

  • labels

    (dict[str, str], default: <class 'dict'> ) –

    Custom labels added to all metrics, e.g. {"instance": "production"}

  • skip_paths

    (set[str], default: <dynamic> ) –

    Custom paths should be skipped from metrics, like /some/endpoint

  • skip_methods

    (set[str], default: {'OPTIONS'} ) –

    HTTP methods which should be excluded from metrics

  • group_paths

    (bool, default: True ) –

    If True (recommended), add request path to metrics literally as described in OpenAPI schema, e.g. /namespaces/{id}, without substitution with path real values.

    If False, all real request paths to metrics, e.g. /namespaces/123.

  • filter_unhandled_paths

    (bool, default: True ) –

    If True, add metrics for paths only mentioned in OpenAPI schema.

    If False, add all requested paths to metrics.