# PHP functions and URLS?

**URL:** <https://discuss.elastic.co/t/php-functions-and-urls/269155>\
**Category:** APM\
**Tags:** php\
**Created:** [April 3, 2021, 3:44pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155 "2021-04-03T15:44:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EwertTheDragon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ewertthedragon/32/86530_2.png) [@EwertTheDragon](https://discuss.elastic.co/u/EwertTheDragon)\
**Post date:** [April 3, 2021, 3:44pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/1 "2021-04-03T15:44:29Z")

</div>

I am not sure if I have set things up correctly, but I am only getting traces of mysql queries, not php functions. It is helpful, but would help even more if I knew which functions are called etc.

 ![bild](https://us1.discourse-cdn.com/elastic/original/3X/d/e/de364d2d58d45d351c03810637484e36186e75a1.png)

Also, the application I have setup have "messy urls", and therefor (I guess?) I more or less only have transactions for index.php. Is it possible to get also the query string?

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [April 3, 2021, 4:37pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/2 "2021-04-03T16:37:16Z")

</div>

I think the query string also gets collected. Do you see it when you click on the transaction' metadata?

If yes you only need to override the defaults a bit to get a solution for both of your questions

---

<div class="post-metadata">

**Author:** ![EwertTheDragon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ewertthedragon/32/86530_2.png) [@EwertTheDragon](https://discuss.elastic.co/u/EwertTheDragon)\
**Post date:** [April 3, 2021, 5:22pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/3 "2021-04-03T17:22:49Z")

</div>

Hi,

Seems that I can't find the query string, when click on the transaction metadata I get this:

 ![bild](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0727ca3710952d15ffc650954358592cbf1a72c.png)

It could be how we run the application that could be the issue? The application, Matomo, is running on Kubernernetes and in one container we run Matomo (alpine php-fpm) and nginx in another. I guess I do not get all the information because of that?

---

<div class="post-metadata">

**Author:** ![EwertTheDragon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ewertthedragon/32/86530_2.png) [@EwertTheDragon](https://discuss.elastic.co/u/EwertTheDragon)\
**Post date:** [April 3, 2021, 5:35pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/4 "2021-04-03T17:35:33Z")

</div>

That image maybe didn't say so much maybe, but only this metadata is available:

```
###### Trace

**trace.id** 70c7f975f2e87e19c75462b9984b1bea

###### Transaction

**transaction.id** 3b7e4a2427b772b7

###### Host

**host.ip** 10.128.0.10

###### Service

| **service.language.name** |PHP|
| --- | --- |
| **service.language.version** |7.4.15|
| **service.name** |AF|
| **service.runtime.name** |PHP|
| **service.runtime.version** |7.4.15|

###### Process

**process.pid** 71

###### Agent

| **agent.name** |php|
| --- | --- |
| **agent.version** |1.0.0|

###### User

No data available
```

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [April 3, 2021, 6:50pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/5 "2021-04-03T18:50:21Z")

</div>

Okay in that case you need to use the API to set the transaction names based on the query string yourself'

> **[Public API | APM PHP Agent Reference \[1.x\] | Elastic](https://www.elastic.co/guide/en/apm/agent/php/current/public-api.html)**

---

<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:** [April 3, 2021, 9:22pm UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/6 "2021-04-03T21:22:39Z")

</div>

Hi @EwertTheDragon! Welcome to our community!

Regarding missing query string - you are right, it's indeed missing. As @Felix_Roessel correctly pointed out it should be displayed at the Transaction details flyout. I've opened a bug ([#389](https://github.com/elastic/apm-agent-php/issues/389)) - thank you very much for reporting it. We will release a new version with the fix ASAP.

Regarding query string not being included in transaction's name - this is as expected according to [the spec](https://github.com/elastic/apm/blob/master/specs/agents/tracing-instrumentation-http.md). I agree with @Felix_Roessel - the best way to include any info in transaction's name is to use [the agent's public API](https://www.elastic.co/guide/en/apm/agent/php/current/public-api.html). At any point in your code you can call:

```auto
ElasticApm::getCurrentTransaction()->setName('my custom TX name');

```

---

<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:** [April 12, 2021, 8:14am UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/7 "2021-04-12T08:14:39Z")

</div>

Hi @EwertTheDragon. We released [1.0.1](https://github.com/elastic/apm-agent-php/releases/tag/v1.0.1) version of the agent that contains the fix for missing query string bug. Please give it a try and let us know how it works out for you.

---

<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:** [May 3, 2021, 4:15am UTC](https://discuss.elastic.co/t/php-functions-and-urls/269155/8 "2021-05-03T04:15:15Z")

</div>

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