Skip to content

FEATURE: Count Pitchfork worker timeouts in Prometheus - #175

Draft
tgxworld wants to merge 5 commits into
mainfrom
tgxworld/pitchfork-timeout-metric
Draft

tgxworld wants to merge 5 commits into
mainfrom
tgxworld/pitchfork-timeout-metric

Conversation

@tgxworld

@tgxworld tgxworld commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

This commit adds discourse_pitchfork_worker_timeouts_total so operators can graph and alert on Pitchfork soft worker timeouts. Each web_worker_timeout event sends one observation synchronously through $prometheus_client before the worker exits.

Requires the core event and the synchronous exporter API. Before merging, release the exporter API and update the plugin's gem version. The currently pinned version does not support PrometheusExporter::Client#send_json_sync.

Operators cannot graph or alert on Pitchfork soft worker timeouts.

This commit exposes `discourse_pitchfork_worker_timeouts_total` when core emits `web_worker_timeout`. Reporting uses a dedicated synchronous client with a one-second budget so observations can reach the collector before worker exit. Hard kills bypassing the callback are not counted.
tgxworld added a commit to discourse/discourse that referenced this pull request Sep 25, 2026
Pitchfork logs worker timeouts, but plugins have no event they can use
to record them.

This commit adds `web_worker_timeout` so the [Prometheus
plugin](discourse/discourse-prometheus#175) can
count timeouts before workers exit.
Use the synchronous client API proposed in discourse/prometheus_exporter#384. Remove explicit queue draining and Ruby Timeout. The draft remains dependent on an exporter release and a matching gem version update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant