Files
VictoriaMetrics/lib/prommetadata/metadata.go
Max Kotliar 94622fef29 lib/prommetadata: enable metrics metadata ingestion and storing by default (#10489)
### Describe Your Changes

Related to
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2974

### Checklist

The following checks are **mandatory**:

- [ ] My change adheres to [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/victoriametrics/contributing/#pull-request-checklist).
- [ ] My change adheres to [VictoriaMetrics development
goals](https://docs.victoriametrics.com/victoriametrics/goals/).
2026-02-19 18:45:44 +02:00

20 lines
655 B
Go

package prommetadata
import "flag"
var enableMetadata = flag.Bool("enableMetadata", true, "Whether to enable metadata processing for metrics scraped from targets, received via VictoriaMetrics remote write, Prometheus remote write v1 or OpenTelemetry protocol. "+
"See also remoteWrite.maxMetadataPerBlock")
// IsEnabled reports whether metadata processing is enabled.
func IsEnabled() bool {
return *enableMetadata
}
// SetEnabled sets enableMetadata to v and returns the previous value of enableMetadata.
// This function is intended for promscrape tests.
func SetEnabled(v bool) bool {
prev := *enableMetadata
*enableMetadata = v
return prev
}