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

Primarily Prometheus Metrics #134

Merged
merged 14 commits into from
Sep 4, 2024
Merged

Conversation

jonrandahl
Copy link
Contributor

@jonrandahl jonrandahl commented Sep 3, 2024

Focussing primarily on ticket #148 for the addition of Prometheus metrics endpoint to the application, additional changes for error control, usability, and functionality have been interspersed.

Included changes

  • Implemented improved boilerplate metrics integration to offer analysis of current application usage stats
  • Added process_threads gauge to prometheus metrics alongside isolating thread counts to specific status' as per the Rails thread documentation GH-148
  • Updated the approach to resolve GH-142
  • Excluded prometheus metrics from the testing environment to reduce noise in the logs
  • Added puma-metrics gem to provide base metrics for the Puma web server
  • Added the internal_error_event metric to the improved error controls
  • Tweaked the application controller to improve error control and display provided message in themed pages to match the rest of the application

Additional changes

  • Added puma.stats to footer template in development environment only, again as per the approach in the LR_Common_Styles gem
  • Reorganised makefile targets alphabetically as well as mirrored other improvements from the other applications in the suite
  • Updated .rubocop.yml primarily reorganising the rules alphabetically as well as adding CountAsOne to both Metrics/ClassLength and Metrics/MethodLength; includes files with removed earlier disabling of said rules!
  • Updated .gitignore to include ignoring byebug history as well as sets the tmp directory ignore to be anywhere, not just at the project root

Added `CountAsOne: ['array', 'hash', 'heredoc', 'method_call']` to `Metrics/ClassLength` and `Metrics/MethodLength`; also includes files changed by rules, primarily removing erroneous inline disabling commands
updated to include the metrics for filtering and sorting in the metrics dashboard as needed
mirrored makefiles from the other HMLR applications to ensure expected targets exist
Notify subscriber(s) of an internal error event with the payload of the exception once done
expose additional metrics for the puma server
adds templated error pages to mirror other applications as well as controls 404 errors to be ignored in the `instrument_internal_error` metric
Copy link
Contributor

@bogdanadrianmarc bogdanadrianmarc left a comment

Choose a reason for hiding this comment

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

Looks good 👍

Copy link
Contributor

@bogdanadrianmarc bogdanadrianmarc left a comment

Choose a reason for hiding this comment

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

LGTM

@jonrandahl jonrandahl merged commit 4c17e20 into dev Sep 4, 2024
2 checks passed
@jonrandahl jonrandahl deleted the spike/prometheus-metrics-update branch September 4, 2024 08:42
Copy link
Contributor

@DanielCouzens DanielCouzens left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Add metric for puma concurrency/thread use
3 participants