# How to send span stack trace with elastic/apm-agent-php?

**URL:** <https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297>\
**Category:** APM\
**Tags:** ui, php\
**Created:** [October 16, 2020, 5:01am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297 "2020-10-16T05:01:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHostlyFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghostlyfox/32/77310_2.png) [@GHostlyFOX](https://discuss.elastic.co/u/GHostlyFOX)\
**Post date:** [October 16, 2020, 5:01am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/1 "2020-10-16T05:01:48Z")

</div>

How to send span stack trace with elastic/apm-agent-php ?

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [October 18, 2020, 6:15pm UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/2 "2020-10-18T18:15:45Z")

</div>

I've just merged [PR #232](https://github.com/elastic/apm-agent-php/pull/232) and it should now be done automatically for all the spans.  
Please give it a try.

---

<div class="post-metadata">

**Author:** ![GHostlyFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghostlyfox/32/77310_2.png) [@GHostlyFOX](https://discuss.elastic.co/u/GHostlyFOX)\
**Post date:** [October 19, 2020, 5:47am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/3 "2020-10-19T05:47:20Z")

</div>

Can you also specify the sequence in the trace?

---

<div class="post-metadata">

**Author:** ![GHostlyFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghostlyfox/32/77310_2.png) [@GHostlyFOX](https://discuss.elastic.co/u/GHostlyFOX)\
**Post date:** [October 19, 2020, 6:58am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/4 "2020-10-19T06:58:36Z")

</div>

Exsample

```auto
#2 /usr/share/php/PHPUnit/Framework/TestCase.php(626): SeriesHelperTest->setUp()
#3 /usr/share/php/PHPUnit/Framework/TestResult.php(666): PHPUnit_Framework_TestCase->runBare()
#4 /usr/share/php/PHPUnit/Framework/TestCase.php(576): PHPUnit_Framework_TestResult->run(Object(SeriesHelperTest))
#5 /usr/share/php/PHPUnit/Framework/TestSuite.php(757): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#6 /usr/share/php/PHPUnit/Framework/TestSuite.php(733): PHPUnit_Framework_TestSuite->runTest(Object(SeriesHelperTest), Object(PHPUnit_Framework_TestResult))
#7 /usr/share/php/PHPUnit/TextUI/TestRunner.php(305): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#8 /usr/share/php/PHPUnit/TextUI/Command.php(188): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#9 /usr/share/php/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#10 /usr/bin/phpunit(53): PHPUnit_TextUI_Command::main()
#11 {main}"

```

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [October 19, 2020, 10:09am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/5 "2020-10-19T10:09:56Z")

</div>

By sequence do you refer to the index at the beginning of each line?  
If so there is [an issue](https://github.com/elastic/kibana/issues/80949) to have APM UI format stack trace from PHP Agent in the way idiomatic to PHP.

---

<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:** [November 9, 2020, 6:09am UTC](https://discuss.elastic.co/t/how-to-send-span-stack-trace-with-elastic-apm-agent-php/252297/6 "2020-11-09T06:09:59Z")

</div>

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