prometheus/web
Bryan Boreham 7b03796d0f
Scraping: stop storing discovered labels (#15261)
Instead of storing discovered labels on every target, recompute them if
required. The `Target` struct now needs to hold some more data required
to recompute them, such as ScrapeConfig.

This moves the load from every Prometheus all of the time, to just when
someone views Service Discovery in the UI.

The way `PopulateLabels` is used changes; you are no longer expected to
call it with a part-populated `labels.Builder`.

The signature of `Target.Labels` changes to take a `labels.Builder`
instead of a `ScratchBuilder`, for consistency with `DiscoveredLabels`.

This will save a lot of work when many targets are filtered out in
relabeling. Combine with `keep_dropped_targets` to avoid ever computing
most labels for dropped targets.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-12-21 13:33:08 +00:00
..
api/v1 Scraping: stop storing discovered labels (#15261) 2024-12-21 13:33:08 +00:00
ui Merge pull request #15696 from prometheus/merge-release-3.0-into-main 2024-12-18 14:44:50 +00:00
federate.go storage: Implement limit in mergeGenericQuerier 2024-11-07 09:08:23 -08:00
federate_test.go Enable perfsprint linter and fix up code 2024-05-15 17:51:05 +03:00
web.go chore: fix some function names in comment 2024-11-19 12:02:10 +08:00
web_test.go mantine UI: Distinguish between Not Ready and Stopping 2024-09-17 16:02:16 +02:00