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

add http prometheus metrics #3432

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Conversation

maxknee
Copy link

@maxknee maxknee commented Nov 30, 2023

This will add metrics to http endpoints to measure latency and to see if other parts of infra are working

This will close #2421

@CLAassistant
Copy link

CLAassistant commented Nov 30, 2023

CLA assistant check
All committers have signed the CLA.

@maxknee
Copy link
Author

maxknee commented Dec 5, 2023

@jimsheldon would we be able to get some eyes on this?

Copy link

@tphoney tphoney left a comment

Choose a reason for hiding this comment

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

I had a look at this, and based on the documentation for chi-prometheus: You add the middleware. But it looks like you need to add a handle for the endpoint to be active https://github.com/766b/chi-prometheus/blob/master/example/main.go#L23
Am i missing something from the documentation ?

@maxknee
Copy link
Author

maxknee commented Dec 18, 2023

I had a look at this, and based on the documentation for chi-prometheus: You add the middleware. But it looks like you need to add a handle for the endpoint to be active https://github.com/766b/chi-prometheus/blob/master/example/main.go#L23 Am i missing something from the documentation ?

Since there's already a /metrics endpoint, we don't need to add a handler. since chi will use that endpoint already:

running on a locally built version:

# HELP chi_requests_total How many HTTP requests processed, partitioned by status code, method and HTTP path.
# TYPE chi_requests_total counter
chi_requests_total{code="OK",method="GET",path="/",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/api/user",service="api"} 2
chi_requests_total{code="OK",method="GET",path="/api/user",service="server"} 2
chi_requests_total{code="OK",method="GET",path="/api/user/repos",service="api"} 1
chi_requests_total{code="OK",method="GET",path="/api/user/repos",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/favicon.png",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/favicon.png",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/manifest.json",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/manifest.json",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/css/2.abad2096.chunk.css",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/css/2.abad2096.chunk.css",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/css/main.3b0f8240.chunk.css",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/css/main.3b0f8240.chunk.css",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/js/2.ec852595.chunk.js",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/js/2.ec852595.chunk.js",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/js/main.316b22ac.chunk.js",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/js/main.316b22ac.chunk.js",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/Inter-Medium.18b8c68e.ttf",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/Inter-Medium.18b8c68e.ttf",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/Inter-Regular.9cd7588f.ttf",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/Inter-Regular.9cd7588f.ttf",service="web"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/logo.76c744d4.svg",service="server"} 1
chi_requests_total{code="OK",method="GET",path="/static/media/logo.76c744d4.svg",service="web"} 1

@maxknee
Copy link
Author

maxknee commented Dec 18, 2023

@tphoney tphoney merged commit 3c37646 into harness:drone Jan 2, 2024
2 checks passed
@tphoney
Copy link

tphoney commented Jan 2, 2024

thanks @maxknee merged !!

@maxknee
Copy link
Author

maxknee commented Jan 2, 2024

@tphoney do we have an idea when there will be a new release?

@tphoney
Copy link

tphoney commented Jan 2, 2024

@tphoney do we have an idea when there will be a new release?

https://hub.docker.com/r/drone/drone/tags

@maxknee
Copy link
Author

maxknee commented Jan 2, 2024 via email

@pankdev
Copy link

pankdev commented Jan 9, 2024

Hi guys. I've learned about this amazing project, and while reviewing the release notes, I found this particular PR.

From what I can see, your project still uses a very old version of the Chi router, currently at version v5.0.12. This PR introduces a very outdated, abandoned dependency that lacks Go modules support. Moreover, these dependencies are based on an old version of Chi.

I might be misunderstanding this, but don't you think there could be issues with updating Chi because of this outdated dependency?

@xoxys
Copy link

xoxys commented Jan 15, 2024

@maxknee @tphoney This has flooded our Prometheus server with millions of metrics, causing massive performance issues. While we can drop and filter the chi metrics in Prometheus, enabling this by default without an option to disable it in drone might not be the best way. Would you consider adding an option to disable chi metrics in drone?

@maxknee
Copy link
Author

maxknee commented Jan 16, 2024

@maxknee @tphoney This has flooded our Prometheus server with millions of metrics, causing massive performance issues. While we can drop and filter the chi metrics in Prometheus, enabling this by default without an option to disable it in drone might not be the best way. Would you consider adding an option to disable chi metrics in drone?

Yes - working on optimizing it

@maxknee
Copy link
Author

maxknee commented Jan 16, 2024

@xoxys I have this PR up: #3451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants