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 Rake performance instrumentation #1156

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

tombruijn
Copy link
Member

@tombruijn tombruijn commented Jul 4, 2024

Add Rake performance instrumentation

We've had requests from people to instrument Rake tasks for performance over time. I remember giving out a variation of this gist from time to time to make this work for people that wanted it: https://gist.github.com/tombruijn/701a3c5e3f251fb5e3ba8f1f8e908887

Let's add it to AppSignal itself so it can be enabled with a config option, rather than a brittle monkeypatch on top of our existing instrumentation.

It's turned off by default so we don't start collecting a lot more 'requests' that count towards an organization's plan, increasing the cost of AppSignal without notice. We can always decide to enable this in the next major version if we think it's useful to be turned on by default.

Part of #1135

Only call Appsignal.stop once in Rake

In Rake multiple tasks can be executed during the Rake runtime. Either by calling them on the CLI like rake task1 task2 or in their definition with task :task1 => :prerequisite_task.

Don't stop AppSignal when every task is done, only the first task will be instrumented. Use the at_exit hook to register a block that's executed when the Rake process exits to only call Appsignal.stop once.

@tombruijn tombruijn self-assigned this Jul 4, 2024
tombruijn added a commit to appsignal/diagnose_tests that referenced this pull request Jul 4, 2024
We've had requests from people to instrument Rake tasks for performance
over time. I remember giving out a variation of this gist from time to
time to make this work for people that wanted it:
https://gist.github.com/tombruijn/701a3c5e3f251fb5e3ba8f1f8e908887

Let's add it to AppSignal itself so it can be enabled with a config
option, rather than a brittle monkeypatch on top of our existing
instrumentation.

It's turned off by default so we don't start collecting a lot more
'requests' that count towards an organization's plan, increasing the
cost of AppSignal without notice. We can always decide to enable this in
the next major version if we think it's useful to be turned on by
default.

Part of #1135
In Rake multiple tasks can be executed during the Rake runtime. Either
by calling them on the CLI like `rake task1 task2` or in their
definition with `task :task1 => :prerequisite_task`.

Don't stop AppSignal when every task is done, only the first task will
be instrumented. Use the `at_exit` hook to register a block that's
executed when the Rake process exits to only call `Appsignal.stop` once.
@backlog-helper
Copy link

backlog-helper bot commented Jul 8, 2024


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

@tombruijn tombruijn merged commit 2f4102d into main Jul 8, 2024
117 checks passed
@tombruijn tombruijn deleted the rake-performance-instrumentation branch July 10, 2024 18:36
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