Prometheus metrics exporters and scheduled task helpers for observability of file-based automation pipelines.
Exports five Prometheus-compatible metrics about a file processing queue:
| Metric | Description |
|---|---|
{prefix}_incoming_file_count |
Files waiting to be processed |
{prefix}_oldest_file_age_seconds |
Age of the oldest queued file |
{prefix}_error_file_count |
Files in the error directory |
{prefix}_files_processed_today |
Successfully processed today |
{prefix}_script_running |
Whether the processing script is alive (1/0) |
The metric prefix is configurable (default: queue). Output is written atomically (temp file + Move-Item) to prevent Prometheus from reading partial data.
Optionally sends a push heartbeat to Uptime Kuma with queue stats embedded in the message.
Example alert: fire when {prefix}_oldest_file_age_seconds > 300 (files stuck for 5+ minutes).
Registers a Windows scheduled task to run the metrics exporter every N minutes under the SYSTEM account. Handles the TimeSpan.MaxValue overflow workaround (uses 3650 days instead).
- Install Windows Exporter with the textfile collector
- Point the textfile collector at your metrics output directory
- Run
Register-MetricsTask.ps1to create the scheduled task - Configure Prometheus to scrape the Windows Exporter endpoint