-
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
filebeat/input/udp: add initial UDP metrics support #33870
Conversation
daf72d2
to
cdb37c6
Compare
}, nil | ||
} | ||
|
||
func configID(config *conf.C) (string, error) { |
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.
This is probably a good thing to factor out into inputmon.
}, nil | ||
} | ||
|
||
func configID(config *conf.C) (string, error) { |
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 didn't realize that this input is not converted to the v2.Input
interface that provides an ID. Can you please scope what the effort would be to convert it to the new interface.
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.
It looks reasonably straight forward. The only inputs here that are v2 are filestream, journald, kafka, unix and winlog. The update would be better in another PR.
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.
cdb37c6
to
6cd27d6
Compare
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
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.
This looks good. I have some naming suggestions. Can you please a table to the UDP input docs that describes the metrics (the aws-s3 input doc has an example).
filebeat/input/udp/input.go
Outdated
if id == "" { | ||
return nil | ||
} | ||
reg, unreg := inputmon.NewInputRegistry("udp", id+"::"+device, nil) |
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.
For the case of Fleet where an id
should be present in the config, my desire would be to have same value represented in the metrics. Could we keep the ID as is in that case (without appending a device)
filebeat/input/udp/input.go
Outdated
reg, unreg := inputmon.NewInputRegistry("udp", id+"::"+device, nil) | ||
out := &inputMetrics{ | ||
unregister: unreg, | ||
bufferLen: monitoring.NewUint(reg, "udp_read_buffer_length"), |
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.
Our monitoring package does not have the concept of a gauge so I have been suffixing new gauges with _gauge
. This gives you a quick hint how this value should be interpreted. It also hints to the monitoring log reporter that it should not compute a delta between the previous sample when logging this value. So can you add a suffix to this one.
Register("histogram", metrics.NewHistogram(out.arrivalPeriod)) | ||
_ = adapter.NewGoMetrics(reg, "udp_processing_time", adapter.Accept). | ||
Register("histogram", metrics.NewHistogram(out.processingTime)) | ||
|
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.
Let me propose some slightly more generic names. Before we ship this in the next release I plan to look across the inputs to see if there are opportunities for alignment on naming.
received_bytes_total
received_events_total
- My thinking is that s/packet/events/ will be more generic and applicable across more inputs.arrival_period
processing_time
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.
received_packets_total
received_events_total
- My thinking is that s/packet/events/ will be more generic and applicable across more
Is the first of these intended to be received_bytes_total
?
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.
Yep. That should have been received_bytes_total. (updated original comment)
1feb8f3
to
923a290
Compare
Kudos, SonarCloud Quality Gate passed! |
} | ||
|
||
func (m *inputMetrics) close() { | ||
if m != nil { |
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.
Ooops. Will send a fix. #33920
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.
What does this PR do?
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.
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