extraLabelsUnparsed=flagutil.NewArray("remoteWrite.label","Optional label in the form 'name=value' to add to all the metrics before sending them to -remoteWrite.url. "+
"Pass multiple -remoteWrite.label flags in order to add multiple flags to metrics before sending them to remote storage")
relabelConfigPath=flag.String("remoteWrite.relabelConfig","","Optional path to file with relabel_config entries. These entries are applied to all the metrics "+
"before sending them to -remoteWrite.url. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config for details")
)
varextraLabels[]prompbmarshal.Label
varprcs[]promrelabel.ParsedRelabelConfig
// initRelabel must be called after parsing command-line flags.
funcinitRelabel(){
// Init extraLabels
for_,s:=range*extraLabelsUnparsed{
n:=strings.IndexByte(s,'=')
ifn<0{
logger.Panicf("FATAL: missing '=' in `-remoteWrite.label`. It must contain label in the form `name=value`; got %q",s)
// extraLabels must be added before applying relabeling according to https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write