Checking in the source code:
if c.Action == LabelDrop || c.Action == LabelKeep {
if c.SourceLabels != nil ||
c.TargetLabel != DefaultRelabelConfig.TargetLabel ||
c.Modulus != DefaultRelabelConfig.Modulus ||
c.Separator != DefaultRelabelConfig.Separator ||
c.Replacement != DefaultRelabelConfig.Replacement {
return fmt.Errorf("%s action requires only 'regex',
and no other fields", c.Action)
}
}
AFAICS, there's no way that labelkeep or labeldrop can be made conditional
on the metric name.
I *think* it should be possible to drop a label by replacing its value with
empty string, in which case:
- source_labels: [__name__]
regex: B
target_label: junk_label
replacement: ""
But you'll have to do that 147 times.
In any case, I would question:
1. Why do you want to drop the labels? Presumably these are static
(otherwise you'd have an explosion in time series), in which case, the
overhead is very small and you're going to save almost no storage by
removing them.
2. If these labels are superfluous, why are they being generated in the
first place? Can you fix the exporter?
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/prometheus-users/5bf6ad05-3bbb-467e-8376-d94129121facn%40googlegroups.com.