Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Expose traceId in PHP for Enhanced Observability #11885

Closed
2 of 3 tasks
warshipJian opened this issue Feb 18, 2024 · 6 comments
Closed
2 of 3 tasks

[Feature] Expose traceId in PHP for Enhanced Observability #11885

warshipJian opened this issue Feb 18, 2024 · 6 comments
Assignees
Labels
agent Language agent related. feature New feature php PHP agent related
Milestone

Comments

@warshipJian
Copy link

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

I've been using SkyWalking for monitoring and tracing in both Java and PHP environments. One thing I noticed is that in Java, it's straightforward to use traceId for correlating logs and traces, which is super helpful for debugging and observability.

However, in PHP, there doesn't seem to be a straightforward way to access or expose the traceId within the application. This makes it a bit challenging to link logs with traces directly, which is something I believe could greatly benefit PHP developers focused on improving application observability.

Is there any chance we could see a feature in the PHP agent that allows accessing the traceId directly from the PHP code? It would be a huge boost for logging and monitoring practices in PHP applications.

Use case

No response

Related issues

No response

Are you willing to submit a pull request to implement this on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@warshipJian warshipJian added the feature New feature label Feb 18, 2024
@wu-sheng
Copy link
Member

@jmjoy What do you think about this?

@wu-sheng wu-sheng added agent Language agent related. php PHP agent related labels Feb 18, 2024
@jmjoy
Copy link
Member

jmjoy commented Feb 18, 2024

Very good, but how to Expose traceId is worth discussing. What I think of is by injecting the $_SERVER variable for php-fpm, or $request->server for swoole.

@wu-sheng
Copy link
Member

Is $_SW_TRACE_ID a valid and good variable name for PHP ecosystem?

@jmjoy
Copy link
Member

jmjoy commented Feb 18, 2024

Is $_SW_TRACE_ID a valid and good variable name for PHP ecosystem?

I think it's ok

@wu-sheng
Copy link
Member

@heyanlong
Copy link
Member

We can add SW_TRACE_ID to $_SERVER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. feature New feature php PHP agent related
Projects
None yet
Development

No branches or pull requests

4 participants