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

[Bug] skywalking-php Unable to capture connect information by using variables to connect Redis #10996

Closed
2 of 3 tasks
zheyu1995 opened this issue Jun 26, 2023 · 1 comment · Fixed by apache/skywalking-php#80
Assignees
Labels
bug Something isn't working and you are sure it's a bug! php PHP agent related
Milestone

Comments

@zheyu1995
Copy link

Search before asking

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

Apache SkyWalking Component

PHP (apache/skywalking-php)

What happened

Code for using variables

<?php
echo '111';
{
    try {
      $client = new Redis();
      $host = "127.0.0.1";
      $port = "6379";
      $client->connect($host, $port, 1);
      $client->set('foo', '1111');
    } catch (RedisException $e) {
    }
}
echo "ok";

image

Code for Unused Variables

<?php

echo '111';

{
        $client = new Redis();
        $client->connect("127.0.0.1", 6379, 1);
        $client->set('foo', '1111');
}

echo "ok";

image

What you expected to happen

image

How to reproduce

<?php
echo '111';
{
    try {
      $client = new Redis();
      $host = "127.0.0.1";
      $port = "6379";
      $client->connect($host, $port, 1);
      $client->set('foo', '1111');
    } catch (RedisException $e) {
    }
}
echo "ok";

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@zheyu1995 zheyu1995 added the bug Something isn't working and you are sure it's a bug! label Jun 26, 2023
@wu-sheng wu-sheng added the php PHP agent related label Jun 26, 2023
@wu-sheng wu-sheng added this to the PHP - 0.4.0 milestone Jun 26, 2023
@jmjoy
Copy link
Member

jmjoy commented Jun 28, 2023

Because the $port is string, skywalking agent except it to int failed, I will adapt this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working and you are sure it's a bug! php PHP agent related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants