Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Fix HTTP endpoint metrics #4751

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

csweichel
Copy link
Contributor

@csweichel csweichel commented Jul 8, 2021

This PR fixes the HTTP endpoint metrics on server, and makes them work for websocket connections.

How to test

  1. Produce a bunch of requests against the server, including websocket reconnects (e.g. reload the dashboard, visit /api/version)
  2. Inspect the server metrics looking for gitpod_server_http_requests_*

fixes #4741

@csweichel csweichel requested review from a team and corneliusludmann and removed request for a team July 8, 2021 12:50
@csweichel csweichel force-pushed the csweichel/server-produce-metrics-4741 branch from c426a6a to a1a7269 Compare July 8, 2021 12:51
Copy link
Contributor

@corneliusludmann corneliusludmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. 👍

It's odd that statusCode is 0 here but I guess that's expected, right?

gitpod_server_http_requests_total{method="GET",route="/gitpod",statusCode="0"} 14

@csweichel
Copy link
Contributor Author

csweichel commented Jul 8, 2021

Change looks good. 👍

It's odd that statusCode is 0 here but I guess that's expected, right?

gitpod_server_http_requests_total{method="GET",route="/gitpod",statusCode="0"} 14

That is expected indeed. It's the same behaviour we've seen from caddy

@csweichel csweichel merged commit 2a544ee into main Jul 9, 2021
@csweichel csweichel deleted the csweichel/server-produce-metrics-4741 branch July 9, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[server] Produce metrics for all HTTP endpoints (incl. websockets)
2 participants