-
Notifications
You must be signed in to change notification settings - Fork 116
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
Automatically ignore Rails' health-check #1317
Conversation
✔️ All good! |
Wondering how to move forward with this. The idea of ignoring this by default makes sense to me. But adding it into the config option means that, when customers override the config option, they'll override this as well, forcing them to add it back manually as part of the override. However, that's also how the We could make the config option merge with the default list instead of replacing it, but then that's equivalent to it being hardcoded -- there's no way customers can delete this entry from the list. Which is fine, probably? I see no use case for wanting calls to this endpoint to be instrumented. EDIT: Decided to go with the first option for now, open to changing it though. Will wait to move forward until @tombruijn is back. |
0684bc1
to
f4207ba
Compare
Suggested by a customer: https://app.intercom.com/a/inbox/yzor8gyw/inbox/shared/unassigned/conversation/16410700366724#part_id=comment-16410700366724-21909575460 Adds `Rails::HealthController#show` to the default `ignore_actions` value. Modified some existing tests that used `ignore_actions` as an array config option that defaulted to empty, so that they use `ignore_errors` instead.
f4207ba
to
9bbc5f2
Compare
This is a limitation for the YAML file mostly. In the Appsignal.configure do |config|
# Overwrite defaults with a new list of ignored actions
config.ignore_actions = ["MyController#action"]
# Delete specific defaults and keep other gem defaults
config.ignore_actions.delete("Rails::HealthController#show")
# Merge app config with gem defaults
config.ignore_actions << "MyController#action"
end For the environment variables I hope this is less of an issue and we can wait until someone presents us a case where it needs to be done using environment variables, and cannot be somehow done with the |
:ignore_actions => [ | ||
"Rails::HealthController#show" | ||
], |
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.
I think it would be better to add these to the Rails loader defaults, like the other Rails specific config. It will be part of the config of apps using both Rails and another framework.
Appsignal::Config.add_loader_defaults( |
Feedback needs to be addressed and approved before merging. |
I can pick this up while Noemi is away. |
Created a new PR with a different implementation here: #1321 |
Suggested by a customer: https://app.intercom.com/a/inbox/yzor8gyw/inbox/shared/unassigned/conversation/16410700366724#part_id=comment-16410700366724-21909575460
(leaving this as a draft to not forget; will make a proper PR later)
Adds
Rails::HealthController#show
to the defaultignore_actions
value.
Modified some existing tests that used
ignore_actions
as an arrayconfig option that defaulted to empty, so that they use
ignore_errors
instead.
See https://github.com/appsignal/diagnose_tests/compare/add-ignore-actions-ruby-default-value for diagnose tests changes.