My elastic apm is not showing stack trace of a transaction

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

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 **

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


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"
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

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

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 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?

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


apm, we instrumented, both tools on the same api. to check the difference.

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

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.

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.

You me at also want to look at inferred spans

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


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

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

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.

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