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] Redis params could be array #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Watchers/RedisCommand/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public static function serializeCommand(string $command, array $params): string
// Serialize the allowed number of arguments
$paramsToSerialize = ($paramsToSerializeNum >= 0) ? array_slice($params, 0, $paramsToSerializeNum) : $params;

// Map each parameter to a string representation
$paramsToSerialize = array_map(function ($param) {
return is_array($param) ? json_encode($param) : (string)$param;
}, $paramsToSerialize);

// If there are more arguments than serialized, add a placeholder
if (count($params) > count($paramsToSerialize)) {
$paramsToSerialize[] = '[' . (count($params) - $paramsToSerializeNum) . ' other arguments]';
Expand Down