console/clickhouse: use ExporterAddress instead of ExporterName for %

There is more guarantee that this is unique.
This commit is contained in:
Vincent Bernat
2023-02-09 21:22:08 +01:00
parent d5cde97891
commit f07e930e60
2 changed files with 3 additions and 3 deletions

View File

@@ -199,10 +199,10 @@ func (c *Component) contextFunc(inputStr string) context {
case "inl2%":
// That's like l2bps, but this time we use the interface speed to get a
// percent value
units = `SUM((Bytes+38*Packets)*SamplingRate*8*100/(InIfSpeed*1000000))/COUNT(DISTINCT ExporterName, InIfName)`
units = `SUM((Bytes+38*Packets)*SamplingRate*8*100/(InIfSpeed*1000000))/COUNT(DISTINCT ExporterAddress, InIfName)`
case "outl2%":
// Same but using output interface as reference
units = `SUM((Bytes+38*Packets)*SamplingRate*8*100/(OutIfSpeed*1000000))/COUNT(DISTINCT ExporterName, OutIfName)`
units = `SUM((Bytes+38*Packets)*SamplingRate*8*100/(OutIfSpeed*1000000))/COUNT(DISTINCT ExporterAddress, OutIfName)`
}
c.metrics.clickhouseQueries.WithLabelValues(table).Inc()