Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-1190: update DNS tracking to report latency instead of TS #455

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/mitchellh/mapstructure v1.4.3
github.com/netobserv/gopipes v0.3.0
github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230703082106-1b85351eee43
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230717113312-4a182aa9c26e
github.com/netsampler/goflow2 v1.1.1-0.20220509155230-5300494e4785
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1
Expand Down Expand Up @@ -98,7 +98,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ github.com/netobserv/gopipes v0.3.0 h1:IYmPnnAVCdSK7VmHmpFhrVBOEm45qpgbZmJz1sSW+
github.com/netobserv/gopipes v0.3.0/go.mod h1:N7/Gz05EOF0CQQSKWsv3eof22Cj2PB08Pbttw98YFYU=
github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500 h1:RmnoJe/ci5q+QdM7upFdxiU+D8F3L3qTd5wXCwwHefw=
github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500/go.mod h1:LHXpc5tjKvsfZn0pwLKrvlgEhZcCaw3Di9mUEZGAI4E=
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230703082106-1b85351eee43 h1:YRfSJNFjgwSk8Axu7rcbSpY9ZFa61JISHwZu8BqUNqo=
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230703082106-1b85351eee43/go.mod h1:B0Qlk+QBT3+rf6vf3cF4GNZSPb0PSwQww8kLGkOPdRg=
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230717113312-4a182aa9c26e h1:wj6WDBCK+N+3AzpRtNsTQh2vrCOz8n2AeWD+ZJKQYKs=
github.com/netobserv/netobserv-ebpf-agent v0.3.2-0.20230717113312-4a182aa9c26e/go.mod h1:qnu3gGPF0zBc2QEvt7Hc7j9pA02UQzc0sztr30FWh6o=
github.com/netobserv/prometheus-common v0.31.2-0.20220720134304-43e74fd22881 h1:hx5bi6xBovRjmwUoVJBzhJ3EDo4K4ZUsqqKrJuQ2vMI=
github.com/netobserv/prometheus-common v0.31.2-0.20220720134304-43e74fd22881/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/netsampler/goflow2 v1.1.1-0.20220509155230-5300494e4785 h1:qhDrIMXlk8YV7BxwA6UR/dQVdUzohjLlmrUXymsBx6g=
Expand Down Expand Up @@ -1273,8 +1273,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
3 changes: 1 addition & 2 deletions pkg/pipeline/decode/decode_protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap {
}

if flow.GetDnsId() != 0 {
out["DnsRequestTimeMs"] = flow.TimeDnsReq.AsTime().UnixMilli()
out["DnsResponseTimeMs"] = flow.TimeDnsRsp.AsTime().UnixMilli()
out["DnsLatencyMs"] = flow.DnsLatency.AsDuration().Milliseconds()
out["DnsId"] = flow.GetDnsId()
out["DnsFlags"] = flow.GetDnsFlags()
out["DnsFlagsResponseCode"] = dnsRcodeToStr(flow.GetDnsFlags() & 0xF)
Expand Down
12 changes: 4 additions & 8 deletions pkg/pipeline/decode/decode_protobuf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func TestDecodeProtobuf(t *testing.T) {
TcpDropLatestFlags: 0x200,
TcpDropLatestState: 6,
TcpDropLatestDropCause: 5,
TimeDnsReq: timestamppb.New(someTime),
TimeDnsRsp: timestamppb.New(someTime),
DnsLatency: durationpb.New(someDuration),
DnsId: 1,
DnsFlags: 0x8001,
TimeFlowRtt: durationpb.New(someDuration),
Expand Down Expand Up @@ -90,8 +89,7 @@ func TestDecodeProtobuf(t *testing.T) {
"TcpDropLatestFlags": uint32(0x200),
"TcpDropLatestState": "TCP_CLOSE",
"TcpDropLatestDropCause": "SKB_DROP_REASON_TCP_CSUM",
"DnsRequestTimeMs": someTime.UnixMilli(),
"DnsResponseTimeMs": someTime.UnixMilli(),
"DnsLatencyMs": someDuration.Milliseconds(),
"DnsId": uint32(1),
"DnsFlags": uint32(0x8001),
"DnsFlagsResponseCode": "FormErr",
Expand Down Expand Up @@ -137,8 +135,7 @@ func TestPBFlowToMap(t *testing.T) {
TcpDropLatestFlags: 0x100,
TcpDropLatestState: 1,
TcpDropLatestDropCause: 4,
TimeDnsReq: timestamppb.New(someTime),
TimeDnsRsp: timestamppb.New(someTime),
DnsLatency: durationpb.New(someDuration),
DnsId: 1,
DnsFlags: 0x80,
TimeFlowRtt: durationpb.New(someDuration),
Expand Down Expand Up @@ -170,8 +167,7 @@ func TestPBFlowToMap(t *testing.T) {
"TcpDropLatestFlags": uint32(0x100),
"TcpDropLatestState": "TCP_ESTABLISHED",
"TcpDropLatestDropCause": "SKB_DROP_REASON_PKT_TOO_SMALL",
"DnsRequestTimeMs": someTime.UnixMilli(),
"DnsResponseTimeMs": someTime.UnixMilli(),
"DnsLatencyMs": someDuration.Milliseconds(),
"DnsId": uint32(1),
"DnsFlags": uint32(0x80),
"DnsFlagsResponseCode": "NoError",
Expand Down
6 changes: 2 additions & 4 deletions pkg/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ parameters:
TcpDropLatestFlags: 1,
TcpDropLatestState: 1,
TcpDropLatestDropCause: 8,
TimeDnsReq: timestamppb.New(startTime),
TimeDnsRsp: timestamppb.New(endTime),
DnsLatency: durationpb.New(someDuration),
DnsId: 1,
DnsFlags: 0x80,
TimeFlowRtt: durationpb.New(someDuration),
Expand Down Expand Up @@ -248,8 +247,7 @@ parameters:
"TcpDropLatestFlags": float64(1),
"TcpDropLatestState": "TCP_ESTABLISHED",
"TcpDropLatestDropCause": "SKB_DROP_REASON_NETFILTER_DROP",
"DnsRequestTimeMs": float64(startTime.UnixMilli()),
"DnsResponseTimeMs": float64(endTime.UnixMilli()),
"DnsLatencyMs": float64(someDuration.Milliseconds()),
"DnsId": float64(1),
"DnsFlags": float64(0x80),
"DnsFlagsResponseCode": "NoError",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/golang.org/x/sys/cpu/hwcap_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading