Skip to content

Conversation

@hagen1778
Copy link
Contributor

This feature might be useful for processes with short lifetime, like CLI tools. For example, vmbackup process might finish before the first metrics reporting. With PushOnShutdown=true it would report metrics on Stop() call.

@hagen1778 hagen1778 requested review from f41gh7 and jiekun September 11, 2025 10:45
@codecov
Copy link

codecov bot commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.46%. Comparing base (afb141d) to head (6e175c1).

Files with missing lines Patch % Lines
push.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   87.58%   87.46%   -0.12%     
==========================================
  Files          12       12              
  Lines        1643     1652       +9     
==========================================
+ Hits         1439     1445       +6     
- Misses        153      155       +2     
- Partials       51       52       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@makasim makasim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This feature might be useful for processes with short lifetime, like CLI tools.
For example, vmbackup process might finish before the first metrics reporting.
With PushOnShutdown=true it would report metrics on Stop() call.
hagen1778 added a commit to VictoriaMetrics/VictoriaMetrics that referenced this pull request Sep 25, 2025
Push metrics on shutdown if `-pushmetrics.url` is configured.
Before metrics reporting might have been skipped because of shutdown.

Obsoletes VictoriaMetrics/metrics#103

Signed-off-by: hagen1778 <[email protected]>
@hagen1778
Copy link
Contributor Author

Closing in favour of VictoriaMetrics/VictoriaMetrics#9767

@hagen1778 hagen1778 closed this Sep 25, 2025
f41gh7 pushed a commit to VictoriaMetrics/VictoriaMetrics that referenced this pull request Sep 30, 2025
Push metrics on shutdown if `-pushmetrics.url` is configured. Before
metrics reporting might have been skipped because of shutdown.

Obsoletes VictoriaMetrics/metrics#103

--------------

To test:
1. Run local VictoriaMetrics instance
2. Build and run vmbackup or vmrestore:
```
make vmbackup && ./bin/vmbackup -storageDataPath=victoria-metrics-data -snapshot.createURL="http://user:pass@localhost:8428/snapshot/create?authKey=foobar" -dst=fs:////vmbackup/dir -pushmetrics.url=http://localhost:8428/api/v1/import/prometheus,http://127.0.0.1:8428/api/v1/import/prometheus
```
3. Try playing with `-pushmetrics.url` (good/bad/many addresses) and
observe logs

Related PR #9767
f41gh7 pushed a commit to VictoriaMetrics/VictoriaMetrics that referenced this pull request Sep 30, 2025
Push metrics on shutdown if `-pushmetrics.url` is configured. Before
metrics reporting might have been skipped because of shutdown.

Obsoletes VictoriaMetrics/metrics#103

--------------

To test:
1. Run local VictoriaMetrics instance
2. Build and run vmbackup or vmrestore:
```
make vmbackup && ./bin/vmbackup -storageDataPath=victoria-metrics-data -snapshot.createURL="http://user:pass@localhost:8428/snapshot/create?authKey=foobar" -dst=fs:////vmbackup/dir -pushmetrics.url=http://localhost:8428/api/v1/import/prometheus,http://127.0.0.1:8428/api/v1/import/prometheus
```
3. Try playing with `-pushmetrics.url` (good/bad/many addresses) and
observe logs

Related PR #9767
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.

2 participants