VictoriaMetrics/app/vmselect/netstorage
Nikolay 773b8b0b28
lib/storage: add tracker for time series metric names statistics
This feature allows to track query requests by metric names. Tracker
state is stored in-memory, capped by 1/100 of allocated memory to the
storage. If cap exceeds, tracker rejects any new items add and instead
registers query requests for already observed metric names.

This feature is disable by default and new flag:
`-storage.trackMetricNamesStats` enables it.

  New API added to the select component:

* /api/v1/status/metric_names_stats - which returns a JSON
object
    with usage statistics.
* /admin/api/v1/status/metric_names_stats/reset - which resets internal
    state of the tracker and reset tsid/cache.

   New metrics were added for this feature:

  * vm_cache_size_bytes{type="storage/metricNamesUsageTracker"}
  * vm_cache_size{type="storage/metricNamesUsageTracker"}
  * vm_cache_size_max_bytes{type="storage/metricNamesUsageTracker"}

  Related issue:
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4458
---------

Signed-off-by: f41gh7 <nik@victoriametrics.com>
Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
2025-03-06 22:10:41 +01:00
..
netstorage.go lib/storage: add tracker for time series metric names statistics 2025-03-06 22:10:41 +01:00
netstorage_test.go app/vmselect/netstorage: eliminate memory allocation for sortBlocksHeap arg when calling mergeSortBlocks() 2023-01-09 21:29:01 -08:00
netstorage_timing_test.go app/vmselect/netstorage: eliminate memory allocation for sortBlocksHeap arg when calling mergeSortBlocks() 2023-01-09 21:29:01 -08:00
tenant_cache.go app/vmselect: fixes multitenant cache init 2024-11-25 11:49:34 +01:00
tenant_cache_test.go vmselect: add support of multi-tenant queries (#6346) 2024-10-01 16:37:18 +02:00
tenant_filters.go vmselect: add support of multi-tenant queries (#6346) 2024-10-01 16:37:18 +02:00
tenant_filters_test.go vmselect: add support of multi-tenant queries (#6346) 2024-10-01 16:37:18 +02:00
tmp_blocks_file.go app/vmselect:add command-line flag -search.inmemoryBufSizeBytes (#6869) 2024-08-26 14:37:45 +02:00
tmp_blocks_file_test.go app/{vminsert,vmselect}: limit the access to storageNodes to getStorageNodesBucket and setStorageNodesBucket functions 2022-10-28 11:41:55 +03:00