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

Better backtraces for linked processes #207

Merged
merged 7 commits into from
May 10, 2017

Conversation

jeffkreeftmeijer
Copy link
Member

Adds ErrorHandler.extract_stacktrace/1, which tries to extract the stacktrace from the exception, as that stack trace will include the line the error happened on as opposed to the stack trace from the error report's :error_info, which does not.

In short (and as shown in 2a5bf34):

(stdlib) gen_server.erl:812: :gen_server.terminate/7
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

... becomes:

(elixir) unicode/unicode.ex:190: String.Unicode.length/1
test/appsignal/error_handler/error_matcher_test.exs:27: Appsignal.ErrorHandler.ErrorMatcherTest.CrashingGenServer.handle_info/2
(stdlib) gen_server.erl:601: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:667: :gen_server.handle_msg/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

jeffkreeftmeijer and others added 3 commits May 2, 2017 15:22
Closes #194.

Instead of using the :background_job namespace,
Appsignal.Phoenix.Channel will use :channel instead. This also allows
users to set their own custom namespaces in
Appsignal.Transaction.start/2.
* Parse new report from agent diagnose mode

The extension returns a JSON object, as a string, which contains the
agent diagnostics report.

The report definition is defined in the diagnose CLI task so we can
check all the tests and display them in a human readable format.

This change makes it possible to return the agent diagnostics report
without capturing the STDOUT while the agent is running. This proved
difficult to do in Elixir, where we previously called the agent
executable directly.

Instead of printing the report to STDOUT the extension will now return
the report as a JSON object, which is formatted as a string which needs
to be parsed into JSON first.

This report may be incomplete when the agent fails to start or something
else goes wrong. Any error will be captured and added to the agent
report.

* Give release upgrade test more time

* Test for agent diagnose report errors and output

* Test for fatal error in agent diagnose report

* Bump agent to da14f3b

- New diagnose report from agent (called through extension).
- Refactor internal extension worker
This change will allow users to send the diagnostics report to
AppSignal. We'll ask before sending if the user wants this, but because
we see how useful this can be when debugging an issue it sends the
report by default. When you press enter, no input, "Y" (yes) is
submitted.

Why this change?
We've seen that in every support request we get we'll ask for the
diagnostics report. To make it easier for everyone this change allows
users to send it directly to AppSignal so our support team can review it
without valuable data getting lost by formatting by our support system
for example.

We also provide the user with a support token when they send the report.
This can be useful for a user if they see a problem with the output and
want to dive right in with the report. They can contact us with the
support token, after which we can immediately review the report.
@jeffkreeftmeijer jeffkreeftmeijer force-pushed the linked-process-backtraces branch from 13444ef to 9ec3869 Compare May 3, 2017 15:08
@wesoudshoorn wesoudshoorn requested a review from thijsc May 8, 2017 08:28
@jeffkreeftmeijer jeffkreeftmeijer changed the base branch from develop to 1.2.2 May 10, 2017 07:12
@jeffkreeftmeijer jeffkreeftmeijer merged commit 1e39fa4 into 1.2.2 May 10, 2017
jeffkreeftmeijer added a commit that referenced this pull request May 10, 2017
Adds `ErrorHandler.extract_stacktrace/1`, which tries to extract the stacktrace from the exception, as that stack trace will include the line the error happened on as opposed to the stack trace from the error report's `:error_info`, which does not.

In short (and as shown in 2a5bf34):

  (stdlib) gen_server.erl:812: :gen_server.terminate/7
  (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

... becomes:

  (elixir) unicode/unicode.ex:190: String.Unicode.length/1
  test/appsignal/error_handler/error_matcher_test.exs:27: Appsignal.ErrorHandler.ErrorMatcherTest.CrashingGenServer.handle_info/2
  (stdlib) gen_server.erl:601: :gen_server.try_dispatch/4
  (stdlib) gen_server.erl:667: :gen_server.handle_msg/5
  (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
@jeffkreeftmeijer jeffkreeftmeijer deleted the linked-process-backtraces branch May 10, 2017 07:42
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.

2 participants