Files
Max Kotliarandf41gh7 5f993f2303 lib/prommetadata: Extract -enableMetadata flag to separate package, avoid pulling in promscrape discovery flags into vminsert
The commit
https://github.com/VictoriaMetrics/VictoriaMetrics/commit/1670b10d44f81e2abae02ac334c074cecf510886
introduced the `-enableMetadata` flag and the
`promscrape.IsMetadataEnabled()` function, which is now used in multiple
places, including the `app/vminsert/prometheusimport` [request
handler](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/b24b76ff08872c60833200b15bba7cfaa11e32d1/app/vminsert/prometheusimport/request_handler.go#L36).

Because of the use of `promscrape` package vminsert registered all
`-promscrape.*` service discovery flags, which were not relevant for
`vminsert`.

This change moves the metadata flag logic into a dedicated package,
preventing vminsert from unintentionally loading unrelated promscrape
flags.

Related PR https://github.com/VictoriaMetrics/VictoriaMetrics/pull/9631
2025-08-29 10:07:16 +02:00
..