prometheus/web/api/v1
Arve Knudsen c65189cc44 tsdb/seriesmetadata: sorted-slice inverted index with copy-on-write
Replace map[uint64]struct{} inner maps in the resource attribute
inverted index with sorted []uint64 slices using copy-on-write
semantics. This reduces memory ~4x (8 bytes/entry vs ~50 bytes/entry
for hash map overhead) and eliminates snapshot copies on read.

sortedInsert/sortedRemove create new slices on mutation, so readers
holding old slices are safe from concurrent changes. LookupResourceAttr
returns the live slice directly (zero-copy).

The layered reader uses two-pointer sorted merge for union operations.
The web API uses two-pointer sorted intersection for filter intersection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-03-20 17:56:16 +01:00
..
testdata tsdb, web/api: incremental head metadata, API pagination, fallback docs 2026-03-20 17:56:16 +01:00
api.go tsdb/seriesmetadata: sorted-slice inverted index with copy-on-write 2026-03-20 17:56:16 +01:00
api_scenarios_test.go tsdb: remove metric metadata persistence, refactor to generic kind framework 2026-03-20 17:56:16 +01:00
api_test.go tsdb, web/api: incremental head metadata, API pagination, fallback docs 2026-03-20 17:56:16 +01:00
codec.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
codec_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
errors_test.go feat: add OTel resource/scope attributes persistence per time series 2026-03-20 17:56:16 +01:00
json_codec.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
json_codec_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
openapi.go web/api: add /resources/series reverse lookup endpoint 2026-03-20 17:56:16 +01:00
openapi_coverage_test.go Add OpenAPI 3.2 specification generation for Prometheus HTTP API (#17825) 2026-01-29 13:36:13 +01:00
openapi_examples.go tsdb: remove metric metadata persistence, refactor to generic kind framework 2026-03-20 17:56:16 +01:00
openapi_golden_test.go web: switch from gopkg.in/yaml to go.yaml.in/yaml (#17979) 2026-02-03 14:15:35 +00:00
openapi_helpers.go Add OpenAPI 3.2 specification generation for Prometheus HTTP API (#17825) 2026-01-29 13:36:13 +01:00
openapi_paths.go tsdb, web/api: incremental head metadata, API pagination, fallback docs 2026-03-20 17:56:16 +01:00
openapi_schemas.go tsdb, web/api: incremental head metadata, API pagination, fallback docs 2026-03-20 17:56:16 +01:00
openapi_test.go chore: fix httpNoBody issues from gocritic 2026-03-02 20:06:30 +01:00
test_helpers.go feat: add OTel resource/scope attributes persistence per time series 2026-03-20 17:56:16 +01:00
translate_ast.go PromQL: Add fill*() binop modifiers to provide default values for missing series 2026-01-15 07:56:21 +01:00