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

[opentelemetry-auto-laravel] Watchers/RedisCommand/Serializer error #1503

Open
090809 opened this issue Feb 5, 2025 · 0 comments
Open

[opentelemetry-auto-laravel] Watchers/RedisCommand/Serializer error #1503

090809 opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@090809
Copy link

090809 commented Feb 5, 2025

Describe your environment

PHP 8.4.3 (cli) (built: Jan 15 2025 01:03:17) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.4.3, Copyright (c) Zend Technologies
    with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans
    with Zend OPcache v8.4.3, Copyright (c), by Zend Technologies
{
  "require": {
    "open-telemetry/opentelemetry-auto-laravel": "^1.0", (1.0.1)
    "open-telemetry/sdk": "^1.2", (1.2.1)
    ...
    "laravel/framework": "^10.0", (10.48.28)
    "laravel/horizon": "^5.24", (5.30.2)
    ...
  }
    

Steps to reproduce
Run php artisan horizon

What is the expected behavior?
No errors

What is the actual behavior?

   Error 

  Object of class Closure could not be converted to string

  at vendor/open-telemetry/opentelemetry-auto-laravel/src/Watchers/RedisCommand/Serializer.php:75
     71▕ 
     72▕         // In some cases (for example when using LUA scripts) arrays are valid parameters
     73▕         $paramsToSerialize = array_map(function($param) { return is_array($param) ? json_encode($param) : $param; }, $paramsToSerialize);
     74▕         
  ➜  75▕         return $command . ' ' . implode(' ', $paramsToSerialize);
     76▕     }
     77▕ }
     78▕ 

      +23 vendor frames 

Additional context
Horizon runs this code snippet:

RedisMasterSupervisorRepository.php:73, Laravel\Horizon\Repositories\RedisMasterSupervisorRepository->get()

        $this->connection()->pipeline(function ($pipe) use ($names) {
            foreach ($names as $name) {
                $pipe->hmget('master:'.$name, ['name', 'pid', 'status', 'supervisors', 'environment']);
            }
        });

Then it, as event, catched via RedisCommandWatcher with parameter - pipeline closure. Closure cannot be converted as string.
Pipeline isnt Redis command, its internal Illuminate/Redis/Connections/PhpRedisConnection construction, but it used for event dispatching also.

Probably, we need drop serialization for "Pipeline" call, as we can't extract data from it correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant