PromEx.ETSCronFlusher (PromEx v1.12.0)

Copy Markdown 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.

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.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

defer_ets_flush(instance)

@spec 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.

start_link(opts)

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

Used to start the PromEx.ETSCronFlusher process.