kyma-project / kyma-project/runtime-watcher

Invalid detection of response status in `executeRequestAndUpdateMetrics`

Open
#599 1 comment 0 reactions 0 assignees View on GitHub

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)

  1. The response code detection is invalid. request.Response is NOT related to the HttpServer response: It is valid for a Response received from remote server when using HTTP Client to send a request.
  2. The metrics.RecordHTTPInflightRequests increase/decrease seems to be wrongly placed. It should "wrap" the call to next.ServeHTTP(), but it does not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.