pushgateway icon indicating copy to clipboard operation
pushgateway copied to clipboard

Delete all metrics grouped by job only not working

Open kaoruu opened this issue 10 years ago • 4 comments

I have the following data in pushgateway:

job="myjobtest_1464406264" instance="127.0.0.1_574910f84b454" job="myjobtest_1464406264" instance="127.0.0.1_574910f8491c3" job="myjobtest_1464406264" instance="127.0.0.1_574910f84ae0d" job="myjobtest_1464406264" instance="127.0.0.1_574910f829084"

curl -X DELETE http://mypushgateway:9091/metrics/job/myjobtest_1464406264

My expectation is that all will be deleted as based on the documentation "Delete all metrics grouped by job only" and since they are all in the same job name. But no data deleted (0/4). Is this a bug?

build info of pushgateway that I used: branch HEAD commit add82b8 date 20150902-14:52:33 user bjoern@reasonableresolution version 0.2.0

kaoruu avatar May 28 '16 03:05 kaoruu

I'm guessing that instance is also in the grouping, so you need to delete each group individually.

brian-brazil avatar May 28 '16 07:05 brian-brazil

I see. I just based my curl call based on the documentation, so I thought by just providing the same job name, it will be automatically removed in group. Or maybe I just misinterpret this. : . . . . . . . .

Delete all metrics grouped by job and instance:
curl -X DELETE http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance

Delete all metrics grouped by job only:
curl -X DELETE http://pushgateway.example.org:9091/metrics/job/some_job

kaoruu avatar May 28 '16 07:05 kaoruu

Grouping is decided upon push. You can only delete those groups. You cannot define a new grouping just for deletion.

beorn7 avatar May 28 '16 12:05 beorn7

thanks brain and beorn7!

kaoruu avatar Jun 01 '16 03:06 kaoruu