Mindsize / mindsize-newrelic

A better implementation of New Relic, with WooCommerce support.
7 stars 1 forks source link

Custom JSON endpoints showing up in root app #6

Open pmgarman opened 6 years ago

pmgarman commented 6 years ago

Custom wp-json endpoint traces are being captured in the root site app, I would have expected these to show up in an API app - is this doable?

pmgarman commented 6 years ago

I may just be running an old version... from my composer.json

"mindsize/mindsize-newrelic": "^1.1",

@javorszky can you confirm that this is how it works in the latest version of the app though? if so - can you tag it as a new version and push it please? :)

javorszky commented 6 years ago

that composer.json doesn't show up

It should be doable. Essentially I'm waiting until rest_api_init to set a transaction, and if the global REST_REQUEST is set (and is true) at that point, the config is set to rest transaction

No transaction should be in the root app to be honest, because the frontend is a catch-all.

All contexts are checked at points that definitely fire within WordPress.

I'm at a loss as to why this would happen.

Can you lower the threshold and capture a trace?

javorszky commented 6 years ago

btw, the reason I wait until rest_api_init and check for REST_REQUEST is precisely because custom rest routes, so I don't miss them if I only preg_match the url to contain wp-json or something similar