#support

Integrating SigNoz in Laravel Application

TLDR Ravi asks for help to integrate SigNoz with Laravel, then runs into issues due to '/' being part of the service name and needs assistance configuring it. Prashant and Ankit suggest solutions but are unable to provide proper guidance on PHP.

Powered by Struct AI

1

1

May 28, 2023 (6 months ago)
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
12:36 PM
Hi Team,
Is there any documentation to integrate SigNoz in Laravel Application?
May 29, 2023 (6 months ago)
Pranay
Photo of md5-8df7ce0274b2473ec07403336e48b574
Pranay
04:35 AM
Do the instructions here help? - https://signoz.io/docs/instrumentation/php/
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
01:27 PM
Thanks Pranay
I finally integrated it. PHP was asking for some more additional packages to install in my mac for integrating Signoz in laraval.
Any Idea why I am getting 404
Image 1 for Thanks <@4K1440>
I finally integrated it. PHP was asking for some more additional packages to install in my mac for integrating Signoz in laraval.
Any Idea why I am getting 404
May 30, 2023 (6 months ago)
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
06:45 AM
Pranay
Prashant
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
07:28 AM
Ravi I don't think that URL is right.

Valid URL for the service laravel should look like this: http://localhost:3301/services/laravel
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
08:10 AM
When I click on service Laravel/Laravel I goes to this URL.
<http://localhost:3301/services/laravel> This URL gives me something went wrong.

If I call this API <http://localhost:3301/api/v1/service/overview>
With Payload:
{"start":"1685367383735000000","end":"1685369183735000000","service":"laravel/laravel","step":60,"tags":[]}

I am getting 200 status with result.

It seems like API is okay with Laravel/Laravel but react application gives me 404
Prashant
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
10:11 AM
It look like a bug due to that / being part of the service name.
can you update the service name to include only alphanumeric characters?

cc Ankit Palash Gupta
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
10:13 AM
I am using PHP laravel. name comes from composer.json
composer.json require / in the name key. like ‘anyvendorName/app-name’
I will check If that can be removed
10:14
Ravi
10:14 AM
Or is there any documentation, where we can add custom name for the app in signoz code (PHP)
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
10:16 AM
/ cannot be part of service name today
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
10:17 AM
you can use resource attribute env to set service name
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
10:17 AM
Ravi try OTEL_SERVICE_NAME env or OTEL_RESOURCE_ATTRIBUTES=service.name=&lt;app_name&gt;

1

Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
10:18 AM
how to use that?
Can you please let me know.
I follow this

https://signoz.io/docs/instrumentation/php/
10:19
Ravi
10:19 AM
As I can se It is passed in command.
OTEL_SERVICE_NAME=signoz-php-app php FILENAME.php

Can’t we set this in code somewhere
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
10:20 AM
you can set this in code as well:
putenv('OTEL_SERVICE_NAME=laravel-app');
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
10:20 AM
It will automatic pick this env value?
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
10:21 AM
yes, it will.

Also, could you share how you have configured it for Laravel app?
It could be helpful for others trying in the framework.
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
10:22 AM
I setup code in
public/index.php

1

May 31, 2023 (6 months ago)
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
03:28 AM
any update on this. Prashant
really appreciated.
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
09:05 AM
seems like mock data are included instead of the actual request data.
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
09:36 AM
can you please suggest
Jun 01, 2023 (6 months ago)
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
03:13 AM
Hi Prashant
Any updates please, what changes we can do to fix.
Jun 03, 2023 (6 months ago)
Ravi
Photo of md5-bdf86df370fc06a921852e874f6c5896
Ravi
08:32 AM
Pranay
Prashant
Can you please guide on this?
We are ready to deploy our app in prod to test SIgnoz
Jun 05, 2023 (6 months ago)
Prashant
Photo of md5-1899629483c7ab1dccfbee6cc2f637b9
Prashant
12:58 PM
Ravi Unfortunately, our team does not have expertise on PHP to properly help you out.

You can refer to OpenTelemetry official docs and GitHub repo.
https://opentelemetry.io/docs/instrumentation/php/getting-started/
https://github.com/open-telemetry/opentelemetry-php

SigNoz Community

Built with ClickHouse as datastore, SigNoz is an open-source APM to help you find issues in your deployed applications & solve them quickly | Knowledge Base powered by Struct.AI

Indexed 1023 threads (61% resolved)

Join Our Community