https://signoz.io logo
#support
Title
# support
r

Ravi B

05/28/2023, 12:36 PM
Hi Team, Is there any documentation to integrate SigNoz in Laravel Application?
p

Pranay

05/29/2023, 4:35 AM
Do the instructions here help? - https://signoz.io/docs/instrumentation/php/
r

Ravi B

05/29/2023, 1: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
@Pranay @Prashant Shahi
p

Prashant Shahi

05/30/2023, 7:28 AM
@Ravi B I don't think that URL is right. Valid URL for the service
laravel
should look like this: http://localhost:3301/services/laravel
r

Ravi B

05/30/2023, 8: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 Shahi
p

Prashant Shahi

05/30/2023, 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 Nayan @Palash Gupta
r

Ravi B

05/30/2023, 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
Or is there any documentation, where we can add custom name for the app in signoz code (PHP)
a

Ankit Nayan

05/30/2023, 10:16 AM
/
cannot be part of service name today
p

Prashant Shahi

05/30/2023, 10:17 AM
you can use resource attribute env to set service name
a

Ankit Nayan

05/30/2023, 10:17 AM
@Ravi B try
OTEL_SERVICE_NAME
env or
OTEL_RESOURCE_ATTRIBUTES=service.name=<app_name>
r

Ravi B

05/30/2023, 10:18 AM
how to use that? Can you please let me know. I follow this https://signoz.io/docs/instrumentation/php/
As I can se It is passed in command.
Copy code
OTEL_SERVICE_NAME=signoz-php-app php FILENAME.php
Can’t we set this in code somewhere
p

Prashant Shahi

05/30/2023, 10:20 AM
you can set this in code as well:
Copy code
putenv('OTEL_SERVICE_NAME=laravel-app');
r

Ravi B

05/30/2023, 10:20 AM
It will automatic pick this env value?
p

Prashant Shahi

05/30/2023, 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.
r

Ravi B

05/30/2023, 10:22 AM
I setup code in public/index.php
any update on this. @Prashant Shahi really appreciated.
p

Prashant Shahi

05/31/2023, 9:05 AM
seems like mock data are included instead of the actual request data.
r

Ravi B

05/31/2023, 9:36 AM
can you please suggest
Hi @Prashant Shahi Any updates please, what changes we can do to fix.
@Pranay @Prashant Shahi Can you please guide on this? We are ready to deploy our app in prod to test SIgnoz
p

Prashant Shahi

06/05/2023, 12:58 PM
@Ravi B 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