# Where to go in Kibana to see Span details for APM?

**URL:** https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056
**Category:** APM
**Tags:** php
**Created:** [October 1, 2024, 4:34am UTC](https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056 "2024-10-01T04:34:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)
#### Post date: [October 1, 2024, 4:34am UTC](https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056/1 "2024-10-01T04:34:11Z")

</div>

I'm trying to learn how spans work with Elasticsearch 8.8 + APM + PHP.

So far it seems my Fleet Server, APM, ELK stack is working. I also got PHP to submit transactions, exceptions and errors to the APM.

The only thing I don't know if I'm doing right is using spans with PHP. Here's my PHP code for a file called `span.php`

```auto
<?php

use Elastic\Apm\ElasticApm;

$transaction = ElasticApm::beginCurrentTransaction(
    'transaction_name',
    'transaction_type'
);

$span = $transaction->beginCurrentSpan(
    'spangled_banner',
    'span_type',
    'span_sub-type', // optional
    'span_action' // optional
);
try {
    // do your thing ...
    echo 'start sleep';
    sleep(3);
    echo 'done sleeping';
} finally {
    $span->end();
}

```

I run this script by visiting `http://localhost/span.php`.

I'm wondering where in Kibana do I go to see this span information? I was hoping to see the word "spangled\_banner" somewhere, but where do I click to?

Here's all that I'm seeing so far:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a765da88501afa94dfb6530608f02d98985c507.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/1/4184dbf871e5b53aed142513d7f875b00e652788.png)

Am I missing something?

---

<div class="post-metadata">

### Author: ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)
#### Post date: [October 1, 2024, 7:52am UTC](https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056/2 "2024-10-01T07:52:36Z")

</div>

Can you click on `GET /span.php` in Transactions tab and scroll down to bottom of the page. You should able to see trace sample in timeline fashion.

---

<div class="post-metadata">

### Author: ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)
#### Post date: [October 1, 2024, 1:31pm UTC](https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056/3 "2024-10-01T13:31:30Z")

</div>

@ashishtiwari1993

Thanks, I clicked as you suggsted but don't see the word `spangled_banner` anywhere.

here's what i see so far under the `transactions>timeline>GET /span.php`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a406aff4dac25562e68536025bf3c3917a3bf7cc.png)

If I click on `GET /span.php` or if I click on Metadata and I see this:

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

Let me know where else I should look? Or maybe my PHP code is wrong and I haven't transmitted the span information yet?

---

<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 8, 2024, 12:16pm UTC](https://discuss.elastic.co/t/where-to-go-in-kibana-to-see-span-details-for-apm/368056/4 "2024-10-08T12:16:56Z")

</div>

The reason for this issue might be the fact that the transaction is begun but not ended.  
There is actually no need to start a transaction since there's always a default transaction that is automatically started ([Public API | APM PHP Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/public-api.html#api-elasticapm-class-get-current-transaction)) and ended by Elastic APM PHP agent itself.  
So one way to fix it:

```auto
<?php

use Elastic\Apm\ElasticApm;

$transaction = ElasticApm::getCurrentTransaction();

$span = $transaction->beginCurrentSpan(
    'spangled_banner',
    'span_type',
    'span_sub-type', // optional
    'span_action' // optional
);
try {
    // do your thing ...
    echo 'start sleep';
    sleep(3);
    echo 'done sleeping';
} finally {
    $span->end();
}

```
