Skip to content

Feat: Add prometheus remote write support#2800

Draft
svenvg93 wants to merge 3 commits into
alexjustesen:2.xfrom
svenvg93:feat/remote-write-prometheus
Draft

Feat: Add prometheus remote write support#2800
svenvg93 wants to merge 3 commits into
alexjustesen:2.xfrom
svenvg93:feat/remote-write-prometheus

Conversation

@svenvg93

@svenvg93 svenvg93 commented May 30, 2026

Copy link
Copy Markdown
Contributor

Important

should be updated and verified after #2802

📃 Description

Adds Prometheus Remote Write support, allowing speedtest metrics to be pushed directly to a remote write endpoint after each speedtest completes. Compatible with Prometheus, VictoriaMetrics, Grafana Cloud (Mimir), and Cortex.

The Prometheus settings tab has been reorganised into two sections: Scrape Endpoint (existing pull-based setup) and Remote Write (new push-based setup).

📖 Documentation

TBD

🪵 Changelog

➕ Added

  • Prometheus Remote Write support — metrics are pushed to a configurable endpoint after each speedtest
  • PrometheusRemoteWriteService to build and send Protobuf-encoded payloads compressed with Snappy
  • App\Jobs\Prometheus\WriteResult job to dispatch remote write asynchronously via the queue
  • Settings for remote write: URL, optional username/password, and enabled toggle
  • Settings migration to add prometheus_remote_write_* keys to the dataintegration group
  • Feature tests for remote write covering enabled/disabled state, authentication, queue dispatch, and HTTP failures

➕ New dependency

The Prometheus Remote Write protocol (spec) mandates that the protobuf payload is compressed with Snappy before sending. The Content-Encoding: snappy header is required — endpoints that implement the spec strictly (including self-hosted Prometheus with --enable-feature=remote-write-receiver) will reject requests with any other encoding, returning a 415 Unsupported Media Type error.

PHP has no built-in Snappy support (unlike gzip via gzencode()), and the only alternative — the ext-snappy PECL extension — requires compiling a native PHP extension into the Docker image, which would complicate the deployment significantly.

flow-php/snappy (^0.38.0) is a pure-PHP implementation of the Snappy algorithm that works without any PHP extension.

✏️ Changed

  • Prometheus settings tab reorganised into Scrape Endpoint and Remote Write sections
  • PrometheusMetricsService and PrometheusRemoteWriteService moved to App\Services\Prometheus\ to align with the existing App\Jobs\Prometheus\ namespace
  • ProcessSpeedtestDataIntegrations listener now dispatches WriteResult job when remote write is enabled

@svenvg93 svenvg93 requested a review from alexjustesen as a code owner May 30, 2026 07:44
@svenvg93 svenvg93 marked this pull request as draft July 4, 2026 09:58
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