VictoriaMetrics/lib/promscrape
Aliaksandr Valialkin 9fbd45a22f
lib/promscrape/discovery/kuma: follow-up for 317fef95f9
- Do not generate __meta_server label, since it is unavailable in Prometheus.
- Add a link to https://docs.victoriametrics.com/sd_configs.html#kuma_sd_configs to docs/CHANGELOG.md,
  so users could click it and read the docs without the need to search the corresponding docs.
- Remove kumaTarget struct, since it is easier generating labels for discovered targets
  directly from the response returned by Kuma. This simplifies the code.
- Store the generated labels for discovered targets inside atomic.Value. This allows reading them
  from concurrent goroutines without the need to use mutex.
- Use synchronouse requests to Kuma instead of long polling, since there is a little sense
  in the long polling when the Kuma server may return 304 Not Modified response every -promscrape.kumaSDCheckInterval.
- Remove -promscrape.kuma.waitTime command-line flag, since it is no longer needed when long polling isn't used.
- Set default value for -promscrape.kumaSDCheckInterval to 30s in order to be consistent with Prometheus.
- Remove unnecessary indirections for string literals, which are used only once, in order to improve code readability.
- Remove unused fields from discoveryRequest and discoveryResponse.
- Update tests.
- Document why fetch_timeout and refresh_interval options are missing in kuma_sd_config.
- Add docs to discoveryutils.RequestCallback and discoveryutils.ResponseCallback,
  since these are public types.

Side notes: it is weird that Prometheus implementation for kuma_sd_configs sets `instance` label,
since usually this label is set by the Prometheus itself to __address__ after the relabeling phase.
See https://www.robustperception.io/life-of-a-label/

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3389

See https://github.com/prometheus/prometheus/issues/7919
and https://github.com/prometheus/prometheus/pull/8844
as a reference implementation in Prometheus
2023-02-22 17:51:51 -08:00
..
discovery lib/promscrape/discovery/kuma: follow-up for 317fef95f9 2023-02-22 17:51:51 -08:00
discoveryutils lib/promscrape/discovery/kuma: follow-up for 317fef95f9 2023-02-22 17:51:51 -08:00
testdata lib/promscrape: fix errors in test config 2022-02-08 19:56:37 +02:00
client.go lib/promscrape: fix cancelling in-flight scrape requests during configuration reload (#3853) 2023-02-22 17:05:16 +01:00
config.go add kuma_sd_config for Kuma Control Plane targets discovery (#3389) (#3840) 2023-02-22 13:59:56 +01:00
config_test.go lib/promscrape: implement target-level and metric-level relabel debugging 2022-12-10 02:09:44 -08:00
config_timing_test.go lib/promscrape: optimize service discovery speed 2022-11-29 21:26:00 -08:00
relabel_debug.go lib/promrelabel: pass query args via query string at /metric-relabel-debug and /target-relabel-debug pages if their length doesnt exceed 1000 2023-01-05 16:48:04 -08:00
scraper.go add kuma_sd_config for Kuma Control Plane targets discovery (#3389) (#3840) 2023-02-22 13:59:56 +01:00
scrapework.go lib/protoparser/prometheus: move streamparser to subpackage (#3814) 2023-02-13 09:26:07 -08:00
scrapework_test.go lib/promscrape: fix honor_labels behavior (#3739) 2023-02-01 11:21:44 -08:00
scrapework_timing_test.go lib/promscrape: add exported_ prefix to metric names exported by scrape targets if they clash with automatically generated metrics 2022-11-28 18:37:09 -08:00
statconn.go lib/promscrape: properly show proxy_url option value at /config page 2021-10-26 21:23:54 +03:00
targetstatus.go lib/promscrape: pre-fetch metric_relabel_configs rules when debugging metric relabeling for a particular target 2023-01-05 03:26:49 -08:00
targetstatus.qtpl lib/promscrape: pre-fetch metric_relabel_configs rules when debugging metric relabeling for a particular target 2023-01-05 03:26:49 -08:00
targetstatus.qtpl.go lib/promscrape: pre-fetch metric_relabel_configs rules when debugging metric relabeling for a particular target 2023-01-05 03:26:49 -08:00