filebeat/input/udp: add initial UDP metrics support#33870
Conversation
daf72d2 to
cdb37c6
Compare
filebeat/input/udp/input.go
Outdated
There was a problem hiding this comment.
This is probably a good thing to factor out into inputmon.
filebeat/input/udp/input.go
Outdated
There was a problem hiding this comment.
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.
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) |
andrewkroh
left a comment
There was a problem hiding this comment.
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.
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.
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.
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_totalreceived_events_total- My thinking is that s/packet/events/ will be more generic and applicable across more inputs.arrival_periodprocessing_time
There was a problem hiding this comment.
received_packets_totalreceived_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.
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 { |
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.asciidocorCHANGELOG-developer.next.asciidoc.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs