scoutapp / roadmap

The public roadmap for Scout application monitoring.
https://scoutapp.com
16 stars 2 forks source link

DevTrace with ajax request and api call #17

Open ckornaros opened 6 years ago

ckornaros commented 6 years ago

If you're using Rails with web framework (React, Angular, etc.) and ajax call, DevTrace will only work on static page but will fail on ajax call :( Same issue with api call. As there is no render page we cannot use DevTrace. Maybe we can have a page with a list of recent requests or the link in a custom header?

cschneid commented 6 years ago

Hi @ckornaros - to clarify, you have a react page that isn't served by rails, that makes ajax calls into a rails app?

If that's what you're looking for, then it is already on our radar, keep track of the agent issue at: https://github.com/scoutapp/scout_apm_ruby/issues/106

ckornaros commented 6 years ago

@cschneid Not exactly. We have react pages served by rails (and we can use devtrace on it) but our react components use ajax calls (to get information or to refresh data) and then devtrace cause 500 and we're unable to have any information. But it's probably a simmilar issue.

itsderek23 commented 6 years ago

@ckornaros - mind sharing the exception you are seeing?

DevTrace does collect information on AJAX calls if the initial page is served via Rails.

ckornaros commented 6 years ago

@itsderek23 It's hard to share you exception because there not really exist. Here is what my developement.log return during my ajax call:

[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (4.76ms)
Completed 200 OK in 188ms (Views: 4.5ms | ActiveRecord: 38.8ms)

Looks good but in my browser I received a 502 :(

Just bellow more log :

my_app        | 172.18.0.1 - - [25/Jan/2018:10:01:32 +0000] "PATCH /admin/tests/15319/ajax_call HTTP/1.0" 200 - 0.5261
nginx_1       | 172.18.0.1 - - [25/Jan/2018:10:01:32 +0000] "PATCH /admin/tests/15319/ajax_call HTTP/1.1" 502 73647 "https://my_address.test/admin/tests/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0"
my_app        | 172.18.0.1 - - [25/Jan/2018:10:01:32 +0000] "GET /500.html HTTP/1.0" 200 73647 0.0090
tscolari commented 6 years ago

It would be nice to support applications that doesn't actually render anything - e.g. API servers.

In my case I have a node dashboard talking to a rails API backend, and I would love to get the metrics from the rails app. Even if it printed in the logs a url to manually copy and paste on the browser for every request it would already be helpful

adamgotterer commented 4 years ago

Been a few year since this was opened. Any update on support for APIs?

doutatsu commented 3 years ago

Would love to see API support as well