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 {
52
52
// Delete metrics from the given pushgateway.
53
53
std::future<int > AsyncDelete ();
54
54
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
+
55
61
private:
56
62
std::string jobUri_;
57
63
std::string labels_;
Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ std::future<int> Gateway::AsyncDelete() {
146
146
return std::async (std::launch::async, [&] { return Delete (); });
147
147
}
148
148
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
+
149
158
void Gateway::CleanupStalePointers (
150
159
std::vector<CollectableEntry>& collectables) {
151
160
collectables.erase (
You can’t perform that action at this time.
0 commit comments