How can I define these variables at PHP.ini?

Hello,

I am using Fleetserver and integration with elastic APM, and PHP agent at my application (php.ini). I don't know if I configured elastic_apm.server_url at php.ini properly. I want to understand how its works. What are Host and URL, for example, setting up through integration I only need to put my Elasticsearch URL and the port? Or do I need to set up APM SERVER too? How is data sent (I released port 8200 on the firewall and I don't see any data being sent)? It's funny because it is working, on APM Services I can see my application data, for example, but I can't rename elastic_apm.service_name, whatever I put in there, at APM services only show unknown-php-service.

Integration Configuration
image

APM > Services

PHP.ini

Hello @GustavoPires,

Yes I agree with you if it's your first time setting up APM with fleet it's quite confusing. For me I set up the value of Host with 0.0.0.0:8200, and for URL, you have to set it to your public DNS or public IP, I believe 192.168.19.40 is a local ip address. In this case your agent is sending apm data as shown in Kibana, because the agent and your app are in the same local network. Additionally, if you plan to use RUM JS in your frontend, you have to use your public IP or DNS for the apm server url parameter!

Also, why on Kibana it's showing unknown-php-service, because the elastic_apm.service_name is not well set up, it tooks the default value (check here). Maybe try this with double quotes in your PHP.ini:

elastic_apm.service_name = "my-php-service"

Hope it helps,

Marwane.

1 Like

My elastic_apm.service_name was:

elastic_apm.service_name = "a"

But nothing appears different, only the same name "my-php-service".
My environment is an on-premises elastic stack, 192.168.19.40 is my elasticsearch IP.
I will try to make that changes! Thanks very much for the answers.

1 Like

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