Skip to content

Commit

Permalink
NETOBSERV-1466 rely on duplicate different than 'true' for prom queri…
Browse files Browse the repository at this point in the history
…es (#580)

* rely on duplicate different than 'true' for prom queries

* bump FLP

---------

Co-authored-by: Joel Takvorian <jtakvori@redhat.com>
  • Loading branch information
jpinsonneau and jotak authored Feb 26, 2024
1 parent f4d840b commit c2e613b
Show file tree
Hide file tree
Showing 56 changed files with 377 additions and 191 deletions.
14 changes: 8 additions & 6 deletions apis/flowmetrics/v1alpha1/flowmetric_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const (
HistogramMetric MetricType = "Histogram"
// Note: we don't expose gauge on purpose to avoid configuration mistake related to gauge limitation.
// 99% of times, "counter" or "histogram" should be the ones to use. We can eventually revisit later.
MatchExact FilterMatchType = "Exact"
MatchRegex FilterMatchType = "Regex"
MatchEqual FilterMatchType = "Equal"
MatchNotEqual FilterMatchType = "NotEqual"
MatchPresence FilterMatchType = "Presence"
MatchAbsence FilterMatchType = "Absence"
MatchRegex FilterMatchType = "MatchRegex"
MatchNotRegex FilterMatchType = "NotMatchRegex"
Egress FlowDirection = "Egress"
Ingress FlowDirection = "Ingress"
AnyDirection FlowDirection = "Any"
Expand All @@ -48,8 +50,8 @@ type MetricFilter struct {
Value string `json:"value"`

// Type of matching to apply
// +kubebuilder:validation:Enum:="Exact";"Regex";"Presence";"Absence"
// +kubebuilder:default:="Exact"
// +kubebuilder:validation:Enum:="Equal";"NotEqual";"Presence";"Absence";"MatchRegex";"NotMatchRegex"
// +kubebuilder:default:="Equal"
MatchType FilterMatchType `json:"matchType"`
}

Expand Down Expand Up @@ -77,7 +79,7 @@ type FlowMetricSpec struct {
ValueField string `json:"valueField,omitempty"`

// `filters` is a list of fields and values used to restrict which flows are taken into account. Oftentimes, these filters must
// be used to eliminate duplicates: `Duplicate:"false"` and `FlowDirection: "0"`.
// be used to eliminate duplicates: `Duplicate != "true"` and `FlowDirection = "0"`.
// Refer to the documentation for the list of available fields: https://docs.openshift.com/container-platform/latest/networking/network_observability/json-flows-format-reference.html.
// +optional
Filters []MetricFilter `json:"filters"`
Expand All @@ -92,7 +94,7 @@ type FlowMetricSpec struct {
Labels []string `json:"labels"`

// When set to `true`, flows duplicated across several interfaces will add up in the generated metrics.
// When set to `false` (default), it is equivalent to adding the exact filter on `Duplicate`: `false`.
// When set to `false` (default), it is equivalent to adding the exact filter on `Duplicate` != `true`.
// +optional
IncludeDuplicates bool `json:"includeDuplicates,omitempty"`

Expand Down
19 changes: 10 additions & 9 deletions bundle/manifests/flows.netobserv.io_flowmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,24 @@ spec:
filters:
description: '`filters` is a list of fields and values used to restrict
which flows are taken into account. Oftentimes, these filters must
be used to eliminate duplicates: `Duplicate:"false"` and `FlowDirection:
"0"`. Refer to the documentation for the list of available fields:
be used to eliminate duplicates: `Duplicate != "true"` and `FlowDirection
= "0"`. Refer to the documentation for the list of available fields:
https://docs.openshift.com/container-platform/latest/networking/network_observability/json-flows-format-reference.html.'
items:
properties:
field:
description: Name of the field to filter on
type: string
matchType:
default: Exact
default: Equal
description: Type of matching to apply
enum:
- Exact
- Regex
- Equal
- NotEqual
- Presence
- Absence
- MatchRegex
- NotMatchRegex
type: string
value:
description: Value to filter on
Expand All @@ -87,10 +89,9 @@ spec:
type: object
type: array
includeDuplicates:
description: 'When set to `true`, flows duplicated across several
interfaces will add up in the generated metrics. When set to `false`
(default), it is equivalent to adding the exact filter on `Duplicate`:
`false`.'
description: When set to `true`, flows duplicated across several interfaces
will add up in the generated metrics. When set to `false` (default),
it is equivalent to adding the exact filter on `Duplicate` != `true`.
type: boolean
labels:
description: '`labels` is a list of fields that should be used as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ metadata:
},
{
"field": "Duplicate",
"value": "false"
"matchType": "NotEqual",
"value": "true"
},
{
"field": "FlowDirection",
Expand Down
19 changes: 10 additions & 9 deletions config/crd/bases/flows.netobserv.io_flowmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,24 @@ spec:
filters:
description: '`filters` is a list of fields and values used to restrict
which flows are taken into account. Oftentimes, these filters must
be used to eliminate duplicates: `Duplicate:"false"` and `FlowDirection:
"0"`. Refer to the documentation for the list of available fields:
be used to eliminate duplicates: `Duplicate != "true"` and `FlowDirection
= "0"`. Refer to the documentation for the list of available fields:
https://docs.openshift.com/container-platform/latest/networking/network_observability/json-flows-format-reference.html.'
items:
properties:
field:
description: Name of the field to filter on
type: string
matchType:
default: Exact
default: Equal
description: Type of matching to apply
enum:
- Exact
- Regex
- Equal
- NotEqual
- Presence
- Absence
- MatchRegex
- NotMatchRegex
type: string
value:
description: Value to filter on
Expand All @@ -89,10 +91,9 @@ spec:
type: object
type: array
includeDuplicates:
description: 'When set to `true`, flows duplicated across several
interfaces will add up in the generated metrics. When set to `false`
(default), it is equivalent to adding the exact filter on `Duplicate`:
`false`.'
description: When set to `true`, flows duplicated across several interfaces
will add up in the generated metrics. When set to `false` (default),
it is equivalent to adding the exact filter on `Duplicate` != `true`.
type: boolean
labels:
description: '`labels` is a list of fields that should be used as
Expand Down
3 changes: 2 additions & 1 deletion config/samples/flows_v1alpha1_flowmetric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ spec:
value: "^\\d\\d?\\d?\\d?$"
matchType: Regex
- field: Duplicate
value: "false"
value: "true"
matchType: NotEqual
- field: FlowDirection
value: "1|2"
matchType: Regex
9 changes: 5 additions & 4 deletions controllers/flp/flp_pipeline_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
flowslatest "github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2"
metricslatest "github.com/netobserv/network-observability-operator/apis/flowmetrics/v1alpha1"
"github.com/netobserv/network-observability-operator/controllers/constants"
"github.com/netobserv/network-observability-operator/pkg/conversion"
"github.com/netobserv/network-observability-operator/pkg/filters"
"github.com/netobserv/network-observability-operator/pkg/helper"
"github.com/netobserv/network-observability-operator/pkg/loki"
Expand Down Expand Up @@ -188,15 +189,15 @@ func flowMetricToFLP(flowMetric *metricslatest.FlowMetricSpec) (*api.MetricsItem
ValueKey: flowMetric.ValueField,
}
for _, f := range flowMetric.Filters {
m.Filters = append(m.Filters, api.MetricsFilter{Key: f.Field, Value: f.Value, Type: strings.ToLower(string(f.MatchType))})
m.Filters = append(m.Filters, api.MetricsFilter{Key: f.Field, Value: f.Value, Type: conversion.PascalToLower(string(f.MatchType), '_')})
}
if !flowMetric.IncludeDuplicates {
m.Filters = append(m.Filters, api.MetricsFilter{Key: "Duplicate", Value: "false", Type: "exact"})
m.Filters = append(m.Filters, api.MetricsFilter{Key: "Duplicate", Value: "true", Type: api.PromFilterNotEqual})
}
if flowMetric.Direction == metricslatest.Egress {
m.Filters = append(m.Filters, api.MetricsFilter{Key: "FlowDirection", Value: "1|2", Type: "regex"})
m.Filters = append(m.Filters, api.MetricsFilter{Key: "FlowDirection", Value: "1|2", Type: api.PromFilterRegex})
} else if flowMetric.Direction == metricslatest.Ingress {
m.Filters = append(m.Filters, api.MetricsFilter{Key: "FlowDirection", Value: "0|2", Type: "regex"})
m.Filters = append(m.Filters, api.MetricsFilter{Key: "FlowDirection", Value: "0|2", Type: api.PromFilterRegex})
}
for _, b := range flowMetric.Buckets {
f, err := strconv.ParseFloat(b, 64)
Expand Down
6 changes: 3 additions & 3 deletions controllers/flp/metrics_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestFlowMetricToFLP(t *testing.T) {
Type: metricslatest.CounterMetric,
ValueField: "val",
Labels: []string{"by_field"},
Filters: []metricslatest.MetricFilter{{Field: "f", Value: "v", MatchType: metricslatest.MatchExact}},
Filters: []metricslatest.MetricFilter{{Field: "f", Value: "v", MatchType: metricslatest.MatchEqual}},
}},
{Spec: metricslatest.FlowMetricSpec{
MetricName: "m_2",
Expand Down Expand Up @@ -92,8 +92,8 @@ func TestFlowMetricToFLP(t *testing.T) {
Type: "counter",
Filter: api.MetricsFilter{Key: "", Value: "", Type: ""},
Filters: []api.MetricsFilter{
{Key: "f", Value: "v", Type: api.PromFilterExact},
{Key: "Duplicate", Value: "false", Type: api.PromFilterExact},
{Key: "f", Value: "v", Type: api.PromFilterEqual},
{Key: "Duplicate", Value: "true", Type: api.PromFilterNotEqual},
},
ValueKey: "val",
Labels: []string{"by_field"},
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/go-logr/logr v1.4.1
github.com/mitchellh/mapstructure v1.5.0
github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934
github.com/netobserv/flowlogs-pipeline v0.1.12-0.20240226132309-70c6881ac821
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
github.com/openshift/api v0.0.0-20220112145620-704957ce4980
Expand All @@ -14,10 +14,10 @@ require (
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.29.1
k8s.io/api v0.29.2
k8s.io/apiextensions-apiserver v0.29.1
k8s.io/apimachinery v0.29.1
k8s.io/client-go v0.29.1
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
k8s.io/kube-aggregator v0.29.1
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.17.0
Expand Down Expand Up @@ -64,10 +64,10 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934 h1:vMJ6tEETHl81Lbzmvs7z7I7PgvyC6WEzlJym2zSWMpQ=
github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934/go.mod h1:Hfcqa5PFrELNp1B4M9e2+rG3226uOiKMi8KEOYBY0ow=
github.com/netobserv/flowlogs-pipeline v0.1.12-0.20240226132309-70c6881ac821 h1:Np0HbQLwzp02GKM7zCH6D6DEZEkQksghjmZdirg6YK8=
github.com/netobserv/flowlogs-pipeline v0.1.12-0.20240226132309-70c6881ac821/go.mod h1:HOeL2VCX/gQoOC6h0g/wvE+dXMw3mNrkK9vPMj0tq50=
github.com/netobserv/prometheus-common v0.46.0-netobserv h1:gpnbXZtSWBauwlSm0aC//mAwAUIvblW6xqNV4mnY2mE=
github.com/netobserv/prometheus-common v0.46.0-netobserv/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
Expand Down Expand Up @@ -249,8 +249,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
Expand Down Expand Up @@ -283,12 +283,12 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down Expand Up @@ -372,15 +372,15 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg=
k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw=
k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ=
k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A=
k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0=
k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw=
k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU=
k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc=
k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc=
k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU=
k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A=
k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks=
k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8=
k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU=
k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg=
k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA=
k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE=
k8s.io/component-base v0.29.1 h1:MUimqJPCRnnHsskTTjKD+IC1EHBbRCVyi37IoFBrkYw=
k8s.io/component-base v0.29.1/go.mod h1:fP9GFjxYrLERq1GcWWZAE3bqbNcDKDytn2srWuHTtKc=
Expand Down
24 changes: 24 additions & 0 deletions pkg/conversion/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,27 @@ func PascalToUpper(str string, splitter rune) string {
}
return sb.String()
}

func PascalToLower(str string, splitter rune) string {
if len(str) == 0 {
return str
}

// check for any exception in map
for k, v := range upperPascalExceptions {
if v == str {
return k
}
}

// Split on capital letters, upper each part and join with splitter
var sb strings.Builder
runes := []rune(str)
for i, r := range runes {
if i > 0 && unicode.IsUpper(r) {
sb.WriteRune(splitter)
}
sb.WriteRune(unicode.ToLower(r))
}
return sb.String()
}
6 changes: 3 additions & 3 deletions pkg/metrics/predefined_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func init() {
Type: "counter",
ValueKey: valueField,
Filters: []flpapi.MetricsFilter{
{Key: "Duplicate", Value: "false"},
{Key: "Duplicate", Value: "true", Type: flpapi.PromFilterNotEqual},
{Key: "FlowDirection", Value: mapDirection[dir], Type: flpapi.PromFilterRegex},
},
Labels: labels,
Expand Down Expand Up @@ -108,7 +108,7 @@ func init() {
Type: "counter",
ValueKey: "PktDropPackets",
Filters: []flpapi.MetricsFilter{
{Key: "Duplicate", Value: "false"},
{Key: "Duplicate", Value: "true", Type: flpapi.PromFilterNotEqual},
{Key: "PktDropPackets", Type: flpapi.PromFilterPresence},
},
Labels: labels,
Expand All @@ -121,7 +121,7 @@ func init() {
Type: "counter",
ValueKey: "PktDropBytes",
Filters: []flpapi.MetricsFilter{
{Key: "Duplicate", Value: "false"},
{Key: "Duplicate", Value: "true", Type: flpapi.PromFilterNotEqual},
{Key: "PktDropBytes", Type: flpapi.PromFilterPresence},
},
Labels: labels,
Expand Down
Loading

0 comments on commit c2e613b

Please sign in to comment.