8000 Tags · jobop/prometheus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tags: jobop/prometheus

Tags

v0.43.9

Toggle v0.43.9's commit message
add http header override future

Signed-off-by: jobop <zw19860913@163.com>

v0.43.8

Toggle v0.43.8's commit message
add http header override future

Signed-off-by: jobop <zw19860913@163.com>

v0.43.7

Toggle v0.43.7's commit message
Provide extended action capabilities for relabel, allowing developers…

… to customize relabel actions when integrating promtherus.

Once developers want to relabel some labels,bug the buildin actions can not meet their needs,they can register their own action function to handle it.

For example, we want to add prefix to all label values,we can register our action function like this

	testPreFixAction := relabel.Action("testprefixaction")
	relabel.Predicates[testPreFixAction] = func(cfg *Config) bool {
	  return true
	}

	relabel.CustomerActions[testPreFixAction] = func(lb *labels.Builder, cfg *Config, val string) (bool, bool) {
	  prefix := cfg.Ext
	  lb.Range(func(l labels.Label) {
	     lb.Set(l.Name, prefix+l.Value)
	    })
	  return true, true
    }

then we can config the relabel config like this
metric_relabel_configs:
  - action: testprefixaction
    ext: 'test-'

then all label values will be added a prefix 'test-'

Signed-off-by: jobop <zw19860913@163.com>
0