promscale icon indicating copy to clipboard operation
promscale copied to clipboard

Deleting non-existing metric using delete_series API returns "Status:OK"

Open hardikm10 opened this issue 3 years ago • 2 comments

curl --insecure -X POST -g 'http://localhost:9201/delete_series?match[]=metric_that_doesnt_exists'

Actual Behavior: {"status":"OK","data":"deleted [] series IDs from [] metrics, affecting 0 rows in total."}

Expected Behavior: It would be preferable if the response could include the fact that the metric does not exist.

hardikm10 avatar Aug 24 '21 07:08 hardikm10

I am not sure that returning a status non-OK will be best since deletion of data is sometimes, implemented as part of CI where deleting an already deleted series happens, in which case it will error if we return non-OK. What we can rather do, have a param as error-on-not-found=true and based on this bool, we change the status if not found. Will that work?

Harkishen-Singh avatar Sep 07 '21 06:09 Harkishen-Singh

Whatever you decide, I only suggested that the API response should make it clear if a non-existing metric is attempted to be deleted.

hardikm10 avatar Sep 23 '21 07:09 hardikm10

closing this issue, as we haven’t received multiple requests from users for this feature and it's quite stale! :)

If you still have a need for this, Please open a new issue.

Thanks!

VineethReddy02 avatar Aug 17 '22 17:08 VineethReddy02