-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
packetbeat/{beater,protos/tcp,protos/udp,sniffer}: add initial metrics for TCP/UDP traffic #33833
Conversation
e999e2a
to
aa0b2d0
Compare
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
6e516a8
to
a09db19
Compare
4c73cd2
to
5f42b79
Compare
This pull request is now in conflicts. Could you fix it? 🙏
|
…raffic This adds metrics for UDP packet count and total bytes, and histograms for time required to process UDP packets prior to acking from a publication and time between UDP packet arrivals.
46640ad
to
2fa2494
Compare
This adds metrics for TCP packet count and total bytes, and histograms for time required to process TCP packets prior to acking from a publication and time between TCP packet arrivals.
device retained in registration ID to prevent collision: panic: name 68DD99D548B50928 already used goroutine 157 [running]: github.com/elastic/elastic-agent-libs/monitoring.panicErr(...) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/pkg/mod/github.com/elastic/[email protected]/monitoring/registry.go:257 github.com/elastic/elastic-agent-libs/monitoring.(*Registry).Add(0xc000569fc0, {0xc00071ae50, 0x10654fd}, {0x35b8160, 0xc0001f8440}, 0x78) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/pkg/mod/github.com/elastic/[email protected]/monitoring/registry.go:155 +0xda github.com/elastic/elastic-agent-libs/monitoring.(*Registry).NewRegistry(0xc000569fc0, {0xc00071ae50, 0x10}, {0x0?, 0x35adc60?, 0x1?}) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/pkg/mod/github.com/elastic/[email protected]/monitoring/registry.go:94 +0x158 github.com/elastic/beats/v7/libbeat/monitoring/inputmon.NewInputRegistry({0x3107792, 0x3}, {0xc00071ae50, 0x10}, 0xc00070ff50?) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/libbeat/monitoring/inputmon/input.go:43 +0x99 github.com/elastic/beats/v7/packetbeat/protos/udp.newInputMetrics({0xc00071ae50?, 0x0?}, {0x0, 0x0}) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/packetbeat/protos/udp/udp.go:155 +0x7c github.com/elastic/beats/v7/packetbeat/protos/udp.NewUDP({0x35d9388, 0xc000314420}, {0xc00071ae50, 0x10}, {0x0, 0x0}) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/packetbeat/protos/udp/udp.go:57 +0x9d github.com/elastic/beats/v7/packetbeat/sniffer.DecodersFor.func1(0x0?, {0x0, 0x0}) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/packetbeat/sniffer/decoders.go:69 +0x22f github.com/elastic/beats/v7/packetbeat/sniffer.(*sniffer).sniffStatic(0xc0002e64b0, {0x35d6f68, 0xc0005695c0}, {0x0, 0x0}) /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/packetbeat/sniffer/sniffer.go:282 +0x159 github.com/elastic/beats/v7/packetbeat/sniffer.(*Sniffer).Run.func1() /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/src/github.com/elastic/beats/packetbeat/sniffer/sniffer.go:202 +0x1be golang.org/x/sync/errgroup.(*Group).Go.func1() /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x64 created by golang.org/x/sync/errgroup.(*Group).Go /var/lib/jenkins/workspace/PR-33833-10-4f1d82ee-c0da-4414-bc63-8fa79cc6cbf5/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0xa5
2cea13b
to
e928577
Compare
When reading pcap files the device is empty, so we can end up with a metric ID collision. We don't need to record metrics when reading from pcap files, so don't return a metric collector when this is the case.
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that you can't access /inputs/
in Packetbeat to retrieve these metrics yet. You'll need to register the handler to make them available like in
beats/filebeat/beater/filebeat.go
Lines 121 to 125 in 9249566
if b.API != nil { | |
if err = inputmon.AttachHandler(b.API.Router()); err != nil { | |
return nil, fmt.Errorf("failed attach inputs api to monitoring endpoint server: %w", err) | |
} | |
} |
…s for TCP/UDP traffic (#33833) This adds metrics for TCP/UDP packet count and total bytes, and histograms for time required to process TCP/UDP packets prior to acking from a publication and time between TCP/UDP packet arrivals.
What does this PR do?
This adds metrics for TCP/UDP packet count and total bytes, and histograms
for time required to process TCP/UDP packets prior to acking from a
publication and time between TCP/UDP packet arrivals.
Why is it important?
This allows us to help users configure their systems to match the requirements that they have.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs