fix: change MetricsPusher to use import prometheus endpoint#1757
Merged
fix: change MetricsPusher to use import prometheus endpoint#1757
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates MetricsPusher from Prometheus remote_write (protobuf + snappy via a Rustler NIF) to pushing plain Prometheus exposition text to a Prometheus import endpoint, optionally gzip-compressed.
Changes:
- Switch
MetricsPusherrequest format/headers totext/plainand useReqgzip body compression (compress_body) instead of remote_write encoding. - Remove the Rustler-based
PrometheusRemoteWriteimplementation and its associated Rust/native build/tooling. - Update
MetricsPushertests and docs to reflect the new import endpoint and gzip option.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/realtime/metrics_pusher.ex | Send Prometheus text format directly, optionally gzip-compressed, and adjust headers/auth setup. |
| test/realtime/metrics_pusher_test.exs | Update expectations to import endpoint + gzip, add a compress=false case, remove remote_write decoding assertions. |
| config/test.exs | Sets a default metrics_pusher_auth for tests. |
| README.md | Clarify that METRICS_PUSHER_URL is for Prometheus exposition format import. |
| mix.exs | Remove :rustler dependency. |
| Dockerfile | Remove Rust toolchain install and native crate copy step. |
| .gitignore | Remove Rust/Rustler build artifact ignores. |
| Removed files (native/prometheus_remote_write/**, tests/fixtures) | Delete the remote_write NIF implementation and its tests/fixtures and workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
d9855d4 to
0233a17
Compare
No need to use snappy and rust. We can simply send the prometheus export format
0233a17 to
347e64d
Compare
filipecabaco
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
No need to use snappy and rust. We can simply send the prometheus export format
More info: https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#how-to-import-data-in-prometheus-exposition-format & https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/#how-to-import-time-series-data