ingress-nginx-helm/internal/ingress
Jacek Nykis 61e699267c
Improve HTTP method label handling in prometheus metrics
## What this PR does / why we need it:

This PR addresses #10208 by checking whether the request method is valid.
For invalid methods we set `method="invalid_method"` label so that operators
can stil see traffic in the metrics but without unbound label value.

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [x] Bug fix (non-breaking change which addresses an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] CVE Report (Scanner found CVE and adding report)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation only

## How Has This Been Tested?

I tested by building the image locally using `make build && make image`
and running the image in minikube.
The change has a fairly narrow scope so should be low risk.

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the [CONTRIBUTION](https://github.com/kubernetes/ingress-nginx/blob/main/CONTRIBUTING.md) guide
- [x] I have added unit and/or e2e tests to cover my changes.
- [x] All new and existing tests passed.
2025-01-20 22:45:22 +00:00
..
annotations Config/Annotations: Add proxy-busy-buffers-size. (#12433) 2024-12-05 18:10:00 +00:00
controller Config/Annotations: Add proxy-busy-buffers-size. (#12433) 2024-12-05 18:10:00 +00:00
defaults Config/Annotations: Add proxy-busy-buffers-size. (#12433) 2024-12-05 18:10:00 +00:00
errors chore: fix function names in comment (#11280) 2024-04-19 02:25:09 -07:00
inspector Fix golangci-lint errors (#10196) 2023-08-31 00:36:48 -07:00
metric Improve HTTP method label handling in prometheus metrics 2025-01-20 22:45:22 +00:00
resolver Fix minor typos (#11935) 2024-09-06 15:59:43 +01:00
status chore: fix function names in comment (#11280) 2024-04-19 02:25:09 -07:00