Skip to content

feat: add prometheus plugin for metrics scraping - #15

Open
418teapotcat wants to merge 8 commits into
v3xlabs:masterfrom
418teapotcat:feat/prometheus-plugin
Open

feat: add prometheus plugin for metrics scraping#15
418teapotcat wants to merge 8 commits into
v3xlabs:masterfrom
418teapotcat:feat/prometheus-plugin

Conversation

@418teapotcat

Copy link
Copy Markdown

Add Prometheus Plugin

New builtin plugin type for scraping Prometheus metrics and publishing them as variables on the launchpi device.

Features

  • Configurable target URL - Connect to any Prometheus-compatible endpoint
  • Scrape interval - Configurable polling (default 30s, minimum 10s)
  • Bearer token auth - Optional authentication support
  • Automatic variable publishing - Each scraped metric becomes a variable
  • query action - Run arbitrary PromQL queries and publish results
  • Preset readouts - CPU, memory, and disk usage with bar charts

Plugin Config Schema

[plugins.prometheus.monitoring]
target = "http://prometheus:9090"
scrape_interval_s = 30
bearer_token = "your-token-here"

Files Added

  • daemon/src/plugins/builtin/prometheus/config.rs - Config structs
  • daemon/src/plugins/builtin/prometheus/mod.rs - Plugin logic, scrape loop, presets
  • daemon/src/plugins/builtin/mod.rs - Module registration

Notes

  • Uses existing plugin architecture (manifest, config, presets, variables)
  • Follows the same patterns as system and http plugins
  • Metrics are truncated to 512 chars in the metrics variable (same as http plugin)
  • Requires Prometheus to be reachable from the launchpi device

@418teapotcat
418teapotcat force-pushed the feat/prometheus-plugin branch 2 times, most recently from 1856748 to 5c67879 Compare August 1, 2026 15:01
Add a new builtin plugin type for scraping Prometheus metrics and
publishing them as variables on the launchpi device.

Features:
- Configurable target URL, scrape interval, and bearer token auth
- Automatic scrape loop publishing each metric as a variable
- query action for arbitrary PromQL queries
- Presets for CPU, memory, and disk usage readouts with bar charts
- Follows the existing plugin architecture (manifest, config, presets)
@418teapotcat
418teapotcat force-pushed the feat/prometheus-plugin branch from 5c67879 to c5bd1ce Compare August 1, 2026 15:10
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.

1 participant