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

feat(metrics): Collect process and Go runtime metrics #2708

Merged

Conversation

hairyhenderson
Copy link
Contributor

Description

A downside of using a custom Prometheus registry rather than the global one is that it has no collectors available. Generally it's quite useful to have the Go collector as well as the Process collector enabled, to track memory, goroutine, file descriptor, CPU, and other metrics useful for observing any Go process.

This PR enables those two.

Before:

$ curl -s http://localhost:1034/metrics | wc -l
29
$ curl -s http://localhost:1034/metrics | grep go_
$

After:

$ curl -s http://localhost:1034/metrics | wc -l
122
$ curl -s http://localhost:1034/metrics | grep go_goroutines
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 13
$

Closes issue(s)

None - small enough change I didn't think it necessary!

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have updated the documentation (README.md and /website/docs)
  • I have followed the contributing guide

Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for go-feature-flag-doc-preview ready!

Name Link
🔨 Latest commit 4f773a1
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/6741b39b9b5e780008c047b7
😎 Deploy Preview https://deploy-preview-2708--go-feature-flag-doc-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.74%. Comparing base (42aa171) to head (4f773a1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2708   +/-   ##
=======================================
  Coverage   84.73%   84.74%           
=======================================
  Files         111      111           
  Lines        5162     5164    +2     
=======================================
+ Hits         4374     4376    +2     
  Misses        624      624           
  Partials      164      164           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

Hey thanks for this one, I agree this is simple enough not to have any issue.
🚀

@thomaspoignant thomaspoignant merged commit c791fe1 into thomaspoignant:main Nov 23, 2024
21 checks passed
@hairyhenderson hairyhenderson deleted the add-go-runtime-metrics branch November 23, 2024 21:33
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.

2 participants