Fix TCP & UDP input metricsets for ports > 32767#46486
Merged
belimawr merged 2 commits intoelastic:mainfrom Sep 10, 2025
Merged
Fix TCP & UDP input metricsets for ports > 32767#46486belimawr merged 2 commits intoelastic:mainfrom
belimawr merged 2 commits intoelastic:mainfrom
Conversation
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16.
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Contributor
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
cmacknz
approved these changes
Sep 10, 2025
Contributor
|
@Mergifyio backport 8.18 8.19 9.0 9.1 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) # Conflicts: # filebeat/input/netmetrics/netmetrics_test.go
6 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685)
6 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) # Conflicts: # filebeat/input/netmetrics/netmetrics_test.go
6 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685)
6 tasks
shmsr
pushed a commit
that referenced
this pull request
Sep 11, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16.
pierrehilbert
pushed a commit
that referenced
this pull request
Sep 12, 2025
…67 (#46524) * Fix TCP & UDP input metricsets for ports > 32767 (#46486) When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) # Conflicts: # filebeat/input/netmetrics/netmetrics_test.go * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
pierrehilbert
pushed a commit
that referenced
this pull request
Sep 12, 2025
When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
pierrehilbert
pushed a commit
that referenced
this pull request
Sep 12, 2025
…767 (#46523) * Fix TCP & UDP input metricsets for ports > 32767 (#46486) When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
pierrehilbert
pushed a commit
that referenced
this pull request
Sep 12, 2025
…767 (#46522) * Fix TCP & UDP input metricsets for ports > 32767 (#46486) When parsing the port to collect metrics, the TCP & UDP inputs were parsing the port as a int16, which limited the maximum port to 32767. This commit fixes it by parsing the port as uint16. (cherry picked from commit 8ee7685) # Conflicts: # filebeat/input/netmetrics/netmetrics_test.go * Fix merge conflicts --------- Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Start Filebeat with the following configuration:
Ensure the following waring is not in the logs:
{ "log.level": "warn", "@timestamp": "2025-09-09T18:02:06.893-0400", "log.logger": "input.udp", "log.origin": { "function": "github.com/elastic/beats/v7/filebeat/input/netmetrics.NewUDP", "file.name": "netmetrics/udp.go", "file.line": 65 }, "message": "failed to get port for 127.0.0.1:42000: strconv.ParseInt: parsing \"42000\": value out of range", "service.name": "filebeat", "id": "8C542040A200BF6D", "host": "127.0.0.1:42000", "ecs.version": "1.6.0" }Start sending some data in the UDP port
Get the input metrics from
http://localhost:5066/inputs/and ensurereceive_queue_lengthis populated.You might have to call
curlmultiple times, as the value some times is zero.## Related issues## Use cases## Screenshots## Logs