[PHP] Can't get a trace of a key transaction

NOTE: this post got flagged as “spam” for no reason by “the community” and got hidden because of it. I’m supposed to edit it to “reflect their feedback” but since there was nothing wrong with the post in the first place, I’m just adding this note. I hope the Staff reviews who wrongly flagged it and ban them, but more importantly, I hope they remove this idiotic system where a post (which should have been a support ticket in the first place and never a post in a public forum, but support tickets aren’t an option even for paying customers) can get automatically hidden without reivew just because somebody randomly flags it.

In my PHP application, I have a web transaction that is pretty fast compared to most transactions, but I want to check if it’s slower than it should be.

So, I would like to have a trace of even just one random execution of this transaction.

I would expect there to be some method in the agent API such as trace_this_transaction() or something, to force the agent to record a trace of the transaction. But there doesn’t seem to be such a thing.

What I can apparently do, is start tracking that transaction as a key transaction, and set a lower value of Apdex T for it. I set an unrealistically low value (10 ms) for T so that any given execution of that transaction will take >4*T and hence will be eligible for being traced.

Yet I don’t get any traces. It says: “no transactions took longer than 0.04 seconds”. Note that the threshold is right. And that’s just not true: the graph shows that every single instance of the transaction did in fact take more than 0.04 seconds.

Even on the live application, where there are slow traces for other transactions relatively frequently, I would expect this one to be the one-in-a-minute that gets picked at least sometimes.
Anyway, I have done the same on a development replica of the website, that nobody but me visits, so there are no other slow transactions competing with the one I want to trace, and yet I get no traces.

What am I missing?

I would appreciate an answer on this one too.

Hello @Teo-WV!

Can you please post a permalink to the transaction in question? (This link will not be open-able by anyone outside your organization or New Relic.)

Reese Lee

I’m trying to post the permalinks here and I get this error:

“Sorry you can’t post a link to that host here”

Also apparently my post got “flagged by the community” for no reason and hidden.

This is the kind of support paying customers get from NewRelic. Wow.

@Teo-WV Following to share that a response regarding this flag was posted here:

Testing to see whether the issue with posting permalinks is fixed:


Can you please post a permalink

So, I replied to that 6 days ago noticing that the system wouldn’t allow me to post permalinks, and I got no reply.
Now I’m seeing that has been fixed, but I wasn’t notified. Was I supposed to keep trying every day until it worked?


It was this transaction:
And this one:
which is the “same” transaction in the development application (a replica of the live one).

However they are no longer set as key transaction. The idea was to set them as key transactions (setting a very low time threshold) temporarily until I could get a single trace, then restore them to normal. It was a month and a half ago when I tried.

Hello @Teo-WV,

I apologize about the permalink confusion and lack of communication around that. We are still working on improvements to our Community, so I appreciate your patience!

So, I do see some traces for https://one.nr/0mMRNpPLGQn, and it appears that it is still set as a Key Transaction: https://one.nr/01qwLv1bzj5. It’s been a few days since you said “they are no longer set as key transaction”, so it may well be that you have changed it back since, but I wanted to point that out in case you did not make that change.

I also wanted to note that setting a Key Transaction only increases the chances of the trace being captured if the apdex_t value is also lowered for the key transaction; it does not guarantee that a trace will be captured regardless of whether they break a configured threshold.

Looking at the other app (where no trace is being captured for the desired transaction), it looks like there are a lot of traces being captured – per our doc on transaction traces:

Here are the default rules that govern which transactions a New Relic agent traces:

  • Over the minute-long harvest cycle, all transactions that violate the threshold (either four times your Apdex T value or a specific number of seconds) are added to a pool of transactions.
  • At the end of that minute, the New Relic agent selects the slowest transaction in that pool and performs a transaction trace on it.

It looks like because you do have so many traces being collected for this app, we won’t see one for the desired transaction, as there are other transactions that meet this criteria. One thing you can try is to increase the overall apdex T value for your application and decrease the custom apdex for the fast transaction. You can see more info in our doc on that here.

I’m still trying to find out if we have a setting that would force a trace to be captured for a specific transaction, but it isn’t looking like we do right now. I’ll circle back if I find anything out to the contrary. Let me know if you have any questions!

Reese Lee

1 Like

I guess I changed it back at some point and forgot to revert it again.

Now that’s convenient, because:

Wow. It’s basically working as expected now. It wasn’t when I started this topic. And if I go back to that day there are no transaction traces, so I can confirm that it wasn’t working then (unless the data that far back in time is deleted and the UI fails to show a warning about that).

Has it been fixed, or is it that it takes more than several minutes, since you set a transaction as key transaction and change the threshold, to when that threshold starts being applied? If so, how long exactly does it take before one can trust the new configuration to be working?

Note that I’m talking about the development application which gets no requests except from me, so most of the time there are definitely no other transactions “competing” to be traced within the harvest cycle.