PromEx.ETSCronFlusher (PromEx v1.1.1) View Source

This module is used to regularly flush ETS of any buffered distribution type metrics (see https://github.com/beam-telemetry/telemetry_metrics_prometheus_core/blob/main/lib/core.ex#L25-L28) for more information. At the moment the flush interval is not configurable but that could change in the future.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

This function will cancel the existing cron timer and schedule a new new. The reason for this being that if metrics scrapes occur regularly, there is no need to flush via the cron job. Cron ETS flushes should only occur if the metrics endpoint for whatever reason fails to be scraped so that ETS is not leaking memory.

Used to start the PromEx.ETSCronFlusher process.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

defer_ets_flush(instance)

View Source

Specs

defer_ets_flush(instance :: module()) :: :ok

This function will cancel the existing cron timer and schedule a new new. The reason for this being that if metrics scrapes occur regularly, there is no need to flush via the cron job. Cron ETS flushes should only occur if the metrics endpoint for whatever reason fails to be scraped so that ETS is not leaking memory.

Specs

start_link(opts :: keyword()) :: GenServer.on_start()

Used to start the PromEx.ETSCronFlusher process.