# My elastic apm is not showing stack trace of a transaction

**URL:** <https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467>\
**Category:** APM\
**Tags:** php\
**Created:** [September 6, 2023, 5:46pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467 "2023-09-06T17:46:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 6, 2023, 5:46pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/1 "2023-09-06T17:46:05Z")

</div>

my elastic apm is not showing stack trace of a transaction  
i have shared the picture

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/6/76345584100b35b9677cd798bf5f37128cec0384.png)

**Kibana version** : 8.9  
**Elasticsearch version** : 8.9  
**APM Server version** : get it installed from kibana elasticagent  
**APM Agent language and version** : php-agent 1.9.11  
\*\*Fresh install \*\*

---

<div class="post-metadata">

**Author:** ![achyutjhunjhunwala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/achyutjhunjhunwala/32/124654_2.png) [@achyutjhunjhunwala](https://discuss.elastic.co/u/achyutjhunjhunwala)\
**Post date:** [September 7, 2023, 1:40pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/2 "2023-09-07T13:40:51Z")

</div>

Hi, Can you click on the Green Bar (Transaction), it will open a flyout with some fields. Search for field `trace.id` there, copy its value and then go to Discover and search for `trace.id: <COPIED_VALUE> and (processor.event: 'span' or processor.event: 'transaction')` and then see how many hits are you getting ?

If you only get 1 hit, it means there is no trace available for that transaction. If you get more hits, we will then might need additional information

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 7, 2023, 3:40pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/3 "2023-09-07T15:40:55Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d21c39af511997b05121b6f8da8c3060926990f.png)  
im getting only a single hit, i guess this means there is no trace available.  
we are moving away from other paid apm service to ELK. in that service we get a complete trace of same transaction. how can we get the complete trance in ELK also.

this is my php agent configurations -  
elastic\_apm.service\_name="prod-api"  
elastic\_apm.secret\_token=""  
elastic\_apm.server\_url="[http://xxxxxapm.us-west-2.aws.cloud.es.io:443](http://xxxxxapm.us-west-2.aws.cloud.es.io:443)"  
elastic\_apm.environment="prod"

i have also tried by changing the log level to trace, still there is no trace.  
my php version is 7.2

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [September 8, 2023, 10:11am UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/4 "2023-09-08T10:11:11Z")

</div>

Hi @Mansoor_Ur_Rehman,

just for clarification, a few things on how Elastic APM works: so what you show on your first screenshot is our water flow chart, which shows the transaction (it's the `HTTP 2xx GET /...`), and then you'd see spans on that given transaction. We do not show the stack trace on that view.

But as seen on the screenshot, the given transaction has zero span on it.

What do you see in the other tool you use?

On the screen you pasted, you'd typically see outgoing HTTP calls, DB calls, calls to messaging services and these kinds of things depending on what your application does. Those things are captured by auto-instrumentation in the Elastic PHP agent. If there is no span below a transaction, then 1) either the application does not do any of the "significant" things that the agent auto instruments, or 2) the agent does not have auto instrumentation for the given operation your application does. Here is a list of all auto instrumentation the PHP agent currently offers: [Supported technologies | APM PHP Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/supported-technologies.html)

Here, I'd also mention that there is a feature called "inferred spans", which we work on for PHP - that's not released yet, but that feature will essentially create spans for methods that take longer and those will show up on that view. You can look up the documentation in this PR: [Added documentation for inferred spans configuration by SergeyKleyman · Pull Request #1049 · elastic/apm-agent-php · GitHub](https://github.com/elastic/apm-agent-php/pull/1049) Again, this feature is not out yet, but may help you in the future.

A few words specifically on stack traces: the agent does capture stack traces as well, but only on spans and not on the transaction. That can be seen when you click on a given span and not directly on the water flow chart. I assume what you actually miss is not the stack trace, but the auto instrumentation, or more detail on what exactly happens within the given HTTP request, right?

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 8, 2023, 7:06pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/5 "2023-09-08T19:06:38Z")

</div>

this is the same trace that we are getting on other tool

 ![Screenshot_1](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7455489657498da0db47dc22fc617fa33350718.png)  
apm, we instrumented, both tools on the same api. to check the difference.

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 8, 2023, 7:07pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/6 "2023-09-08T19:07:10Z")

</div>

i have also instrumented a java application  
i have attatched the screenshot for java elasticapm and of other paid tools

 ![pay](https://us1.discourse-cdn.com/elastic/original/3X/7/7/7766234c6c729bb9c894b335a9dc7fdfd229c824.png)

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 8, 2023, 7:12pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/7 "2023-09-08T19:12:02Z")

</div>

for auto-instrumentation, we are using symfony, it seems like your agent donot support symfony, but im getting the same restult for java springboot also.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 9, 2023, 1:16am UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/8 "2023-09-09T01:16:49Z")

</div>

> [@Mansoor\_Ur\_Rehman](#):
>
> i have also instrumented a java application  
> i have attatched the screenshot for java elasticapm and of other paid tools
> 
> ![pay](https://us1.discourse-cdn.com/elastic/original/3X/7/7/7766234c6c729bb9c894b335a9dc7fdfd229c824.png)

Those extra steps look like method level...to enable that level on Java use the `trace_methods` configuration but be careful you will get very deep instrumentation.

> **[Core configuration options | APM Java Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods)**

You me at also want to look at inferred spans

> **[Core configuration options | APM Java Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods)**

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 11, 2023, 5:53pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/9 "2023-09-11T17:53:41Z")

</div>

thankyou for replying , i have enabled the profiling\_inferred\_spans\_enabled, but still there are no methods, my apm was already showing trace details of mysql, but it donot shows the methods

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/adcfdad1f7751300fda151fb3b7a93d8f9d1437f.png)  
it is also showing the errors, if there are any , but no methods details.  
here is the startup command,

```
java -javaagent:/my-folder/elastic-apm-agent-1.42.0.jar -Delastic.apm.service_name=my-app -Delastic.apm.secret_token=server_token -Delastic.apm.server_url=https://xxxxxxxxxxxxxxxxxxxx.apm.us-xxxx.xxxx.cloud.es.io:443 -Delastic.apm.environment=xxxx -Delastic.apm.application_packages=org.example -Delastic.apm.profiling_inferred_spans_enabled=true -jar target/my-app.jar

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 11, 2023, 5:56pm UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/10 "2023-09-11T17:56:21Z")

</div>

Then try `trace_methods` that I referred you to above ... but be careful to put in the correct application packages

---

<div class="post-metadata">

**Author:** ![Mansoor\_Ur\_Rehman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mansoor_ur_rehman/32/125287_2.png) [@Mansoor\_Ur\_Rehman](https://discuss.elastic.co/u/Mansoor_Ur_Rehman)\
**Post date:** [September 28, 2023, 10:03am UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/11 "2023-09-28T10:03:01Z")

</div>

Thankyou all for replying, i have made multiple changes, but still cannot get the traces and span details, in either java or php,  
can you guys guide me , about what is opentelemtry integration for php, do i need to integrate OT , to get the span details.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 26, 2023, 10:03am UTC](https://discuss.elastic.co/t/my-elastic-apm-is-not-showing-stack-trace-of-a-transaction/342467/12 "2023-10-26T10:03:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
