kyma-project / kyma-project/runtime-watcher
Invalid detection of response status in `executeRequestAndUpdateMetrics`
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1
- Forks
- 18
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 10
Description
There are some problems in executeRequestAndUpdateMetrics function (pkg/event/skr_events_listener.go)
- The response code detection is invalid.
request.Responseis NOT related to the HttpServer response: It is valid for a Response received from remote server when using HTTP Client to send a request. - The
metrics.RecordHTTPInflightRequestsincrease/decrease seems to be wrongly placed. It should "wrap" the call tonext.ServeHTTP(), but it does not.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read pkg/event/skr_events_listener.go and inspect executeRequestAndUpdateMetrics, especially how it determines the response code and places metrics.RecordHTTPInflightRequests around next.ServeHTTP(). Trace the surrounding HTTP handler flow first. Done means response status detection uses the HTTP server response and the inflight metric increase/decrease wraps the ServeHTTP call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100