mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
### 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/).
20 lines
655 B
Go
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
|
|
}
|