Add prometheus metric_version = 2 and url tag configurable (#5767)

This commit is contained in:
Vishwanath
2019-11-20 20:53:57 -08:00
committed by Daniel Nelson
parent c12a403042
commit 12ecdaba5b
5 changed files with 272 additions and 4 deletions

View File

@@ -258,6 +258,18 @@ func (a *Accumulator) HasTag(measurement string, key string) bool {
return false
}
func (a *Accumulator) TagSetValue(measurement string, key string) string {
for _, p := range a.Metrics {
if p.Measurement == measurement {
v, ok := p.Tags[key]
if ok {
return v
}
}
}
return ""
}
func (a *Accumulator) TagValue(measurement string, key string) string {
for _, p := range a.Metrics {
if p.Measurement == measurement {