Skip to content

Conversation

@tsibley
Copy link
Member

@tsibley tsibley commented Jul 23, 2021

wip! api: Expose api- and database-level metrics for Prometheus to scrape

This will let us understand both the volume of requests and request rate
as well as how long requests to the various endpoints are taking, so we
can look at bottlenecks.

Transparently uses a collector that supports multiple processes since in
production we use a hybrid multiprocess and threaded deployment with
uWSGI. This requires a directory for collecting the metrics from each
individual process, which are then aggregated and exported. Metrics are
exported at /v1/metrics.

If no collection directory is defined, then metrics are not collected
and exported.

Disables the default "flask_" prefix on metric names in order to use the
standard Prometheus http_* metrics names as exported by other services.

Disables the histogram metric for request durations to result in a
summary metric instead, which is simpler to deal with on the query side
and should be enough for our needs.

…rape

This will let us understand both the volume of requests and request rate
as well as how long requests to the various endpoints are taking, so we
can look at bottlenecks.

Transparently uses a collector that supports multiple processes since in
production we use a hybrid multiprocess and threaded deployment with
uWSGI.  This requires a directory for collecting the metrics from each
individual process, which are then aggregated and exported.  Metrics are
exported at /v1/metrics.

If no collection directory is defined, then metrics are not collected
and exported.

Disables the default "flask_" prefix on metric names in order to use the
standard Prometheus http_* metrics names as exported by other services.

Disables the histogram metric for request durations to result in a
summary metric instead, which is simpler to deal with on the query side
and should be enough for our needs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants