Skip to content

Commit

Permalink
NETOBSERV-1649: add drop cause & state labels to metrics (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Jul 1, 2024
1 parent 8a49b67 commit cad88b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/metrics/predefined_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var (
DefaultIncludeListLokiDisabled = []string{
"node_ingress_bytes_total",
"workload_ingress_bytes_total",
"workload_ingress_packets_total",
"workload_flows_total",
"workload_drop_bytes_total",
"workload_drop_packets_total",
Expand Down Expand Up @@ -111,6 +112,8 @@ func init() {
tags: []string{group, "rtt"},
})
// Drops metrics
dropLabels := labels
dropLabels = append(dropLabels, "PktDropLatestState", "PktDropLatestDropCause")
predefinedMetrics = append(predefinedMetrics, taggedMetricDefinition{
FlowMetricSpec: metricslatest.FlowMetricSpec{
MetricName: fmt.Sprintf("%s_drop_packets_total", groupTrimmed),
Expand All @@ -119,7 +122,7 @@ func init() {
Filters: []metricslatest.MetricFilter{
{Field: "PktDropPackets", MatchType: metricslatest.MatchPresence},
},
Labels: labels,
Labels: dropLabels,
Charts: dropCharts(group, "pps"),
},
tags: []string{group, tagPackets, "drops"},
Expand All @@ -132,7 +135,7 @@ func init() {
Filters: []metricslatest.MetricFilter{
{Field: "PktDropBytes", MatchType: metricslatest.MatchPresence},
},
Labels: labels,
Labels: dropLabels,
Charts: dropCharts(group, "Bps"),
},
tags: []string{group, tagBytes, "drop"},
Expand Down

0 comments on commit cad88b2

Please sign in to comment.