-
Notifications
You must be signed in to change notification settings - Fork 20
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
Controller name case #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your pull request! I'm fine with this addition in general, just need to clean up the pull request a bit.
P.S> And also please fix linters!
lib/yabeda/rails.rb
Outdated
action: event.payload[:params]["action"], | ||
status: Yabeda::Rails.event_status_code(event), | ||
format: event.payload[:format], | ||
method: event.payload[:method].downcase, | ||
} | ||
puts labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop debugging puts
😄
puts labels |
.by(1) | ||
|
||
described_class.config.controller_name_case = original_case | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Envek this violates the lint rule of a maximum of 5 lines in a spec. I'd suggest this is as compact as we should make this test. Do you want me to add a Rubocop exception comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it here by nesting into context and moving setup code to around hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks @Envek. Been a while since I used Rspec!
I see the class comments now too - will make sure I use those in future.
Released in 0.9.0, please enjoy. |
This allows configuration of the case of controller names in metrics.
This is important for us so we can correlate metrics between different systems, like logs and traces.
I introduced a new
Yabeda::Rails::Event
class to support this change, and so also extracted event-specific concerns from the longYabeda::Rails.install!
method into the newEvent
class.