File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ class PROMETHEUS_CPP_PUSH_EXPORT Gateway {
5252 // Delete metrics from the given pushgateway.
5353 std::future<int > AsyncDelete ();
5454
55+ // Delete metrics from the given pushgateway (for configured instance labels).
56+ int DeleteForInstance ();
57+
58+ // Delete metrics from the given pushgateway (for configured instance labels).
59+ std::future<int > AsyncDeleteForInstance ();
60+
5561 private:
5662 std::string jobUri_;
5763 std::string labels_;
Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ std::future<int> Gateway::AsyncDelete() {
146146 return std::async (std::launch::async, [&] { return Delete (); });
147147}
148148
149+ int Gateway::DeleteForInstance () {
150+ return curlWrapper_->performHttpRequest (detail::HttpMethod::Delete,
151+ jobUri_ + labels_, {});
152+ }
153+
154+ std::future<int > Gateway::AsyncDeleteForInstance () {
155+ return std::async (std::launch::async, [&] { return DeleteForInstance (); });
156+ }
157+
149158void Gateway::CleanupStalePointers (
150159 std::vector<CollectableEntry>& collectables) {
151160 collectables.erase (
You can’t perform that action at this time.
0 commit comments