Ask questionsseries count API returns old value after calling delete series API

Describe the bug I got old return value from /api/v1/series/count after calling /api/v1/admin/tsdb/delete_series.

To Reproduce

After ingesting multiple time series,

$ curl http://localhost:8428/api/v1/series/count

then, delete series from VM.

$ curl -G 'http://localhost:8428/api/v1/admin/tsdb/delete_series' --data-urlencode 'match[]={__name__=~".*"}'

Now, series API returns empty result.

$ curl -G 'http://localhost:8428/api/v1/series' --data-urlencode 'match[]={__name__=~".*"}' --data 'start=0'

But count API still returns old stats.

$ curl http://localhost:8428/api/v1/series/count

Expected behavior

I want to get a correct value from series count API after series deletion.


  • v1.41.0

Used command-line flags

  • nothing

Answer questions ledmonster

I see. Let me explain my background. Since I implements dynamic logic to ingest metrics from IoT devices to VM, I write unit tests for ingestion program with VM and confirm my logic before deploying it to production.

  • start VM container locally
  • run tests
  • stop container

To make each test independent, I delete time series on tear down. And I noticed that count API doesn't be reset with series deletion. For tests, I can achieve my purpose without count API, so current behavior doesn't matter for me. Just for your information. Thanks.


Related questions

Failure to deploy with `helm template` in ArgoCD hot 2
Remote write for Prometheus not working hot 1
Graph missing some points hot 1
How to write data to VictoriaMetrics individually in batches? hot 1
Add data deduplication from HA Prometheus pair based on `--query.replica-label` arg similar to Thanos Query hot 1
Can't start VictoriaMetrics use docker-compose and volume mapping on Windows hot 1
Downsampling data - VictoriaMetrics hot 1
While under heavy load getting error panic hot 1
While under heavy load getting error panic hot 1
While under heavy load getting error panic hot 1
Windows build hot 1
Increase default value for -search.maxPointsPerTimeseries hot 1
changing precisionBits doesn't result in change in precision of stored value hot 1
Drop-in replacement prometheus not work with promxy (Prometheus HA) hot 1
Github User Rank List