mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Merge pull request #11426 from douglascamata/document-and-test-relabel-memory-reuse
Better document possible relabel input modification
This commit is contained in:
commit
b7028c1722
|
@ -202,10 +202,12 @@ func (re Regexp) String() string {
|
||||||
return str[4 : len(str)-2]
|
return str[4 : len(str)-2]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process returns a relabeled copy of the given label set. The relabel configurations
|
// Process returns a relabeled version of the given label set. The relabel configurations
|
||||||
// are applied in order of input.
|
// are applied in order of input.
|
||||||
|
// There are circumstances where Process will modify the input label.
|
||||||
|
// If you want to avoid issues with the input label set being modified, at the cost of
|
||||||
|
// higher memory usage, you can use lbls.Copy().
|
||||||
// If a label set is dropped, EmptyLabels and false is returned.
|
// If a label set is dropped, EmptyLabels and false is returned.
|
||||||
// May return the input labelSet modified.
|
|
||||||
func Process(lbls labels.Labels, cfgs ...*Config) (ret labels.Labels, keep bool) {
|
func Process(lbls labels.Labels, cfgs ...*Config) (ret labels.Labels, keep bool) {
|
||||||
lb := labels.NewBuilder(lbls)
|
lb := labels.NewBuilder(lbls)
|
||||||
if !ProcessBuilder(lb, cfgs...) {
|
if !ProcessBuilder(lb, cfgs...) {
|
||||||
|
|
Loading…
Reference in a new issue