mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
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