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 total requests prometheus metric #420

Merged
merged 6 commits into from
Jan 28, 2023

Conversation

M4tthewDE
Copy link
Contributor

@M4tthewDE M4tthewDE commented Jan 25, 2023

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

Adds an additional metric which tracks which top level routes are used how often. Not quiet happy with how the URL parsing works, but I was not able to find a better way with the std lib.

Closes #415

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Merging #420 (79812ae) into master (1593388) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
- Coverage   44.66%   44.64%   -0.03%     
==========================================
  Files         101      101              
  Lines        3739     3741       +2     
==========================================
  Hits         1670     1670              
- Misses       2021     2023       +2     
  Partials       48       48              
Impacted Files Coverage Δ
cmd/api/main.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pajlada
Copy link
Member

pajlada commented Jan 27, 2023

Could you provide an example of what data is tracked? (i.e. what it looks like at the prometheus endpoint)

Has more detailed stats and better URL parsing
@M4tthewDE
Copy link
Contributor Author

I switched to the premade middleware, since it has better URL parsing and more detailed metrics.

How the metrics look like: https://github.com/766b/chi-prometheus#what-do-you-get

cmd/api/prometheus.go Outdated Show resolved Hide resolved
@pajlada pajlada merged commit ac46f2d into Chatterino:master Jan 28, 2023
pajlada added a commit that referenced this pull request Jan 29, 2023
pajlada added a commit that referenced this pull request Jan 29, 2023
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.

Additional prometheus metrics
2 participants