-
Notifications
You must be signed in to change notification settings - Fork 0
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
FRW-8618 Init commit #1
FRW-8618 Init commit #1
Conversation
composer.json
Outdated
"open-telemetry/context": "^1.0", | ||
"open-telemetry/sem-conv": "^1.0", | ||
"php": ">=8.1", | ||
"spryker/rabbit-mq": "dev-master", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why maste?
->setAttribute(static::ATTRIBUTE_QUEUE_NAME, $params[0]); | ||
|
||
if (static::isValidMessage($params)) { | ||
$array = json_decode($params[1][0]->getBody(), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name variables in more descriptive name. Array is quite generic name
->startSpan() | ||
->activate(); | ||
}, | ||
post: function ($instance, array $params, $response, ?Throwable $exception): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be typehinted
$span->recordException($exception); | ||
$span->setStatus(StatusCode::STATUS_ERROR); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this empty line
} | ||
|
||
$endTime = microtime(true); | ||
$duration = $endTime - $span->getAttribute(static::START_TIME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some consideration, not sure if needed.
First of all span has getDuration method.
And also it's auto added to the span
*/ | ||
protected static function isValidMessage(array $params): bool | ||
{ | ||
return array_key_exists(1, $params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return array_key_exists(1, $params) | |
$PLEASE_RENAME_TO_SMTH_DESCRIPTIVE = $params[1][0] ?? null; | |
if (!$PLEASE_RENAME_TO_SMTH_DESCRIPTIVE) { | |
return false; | |
} | |
return $PLEASE_RENAME_TO_SMTH_DESCRIPTIVE instanceof QueueSendMessageTransfer && is_string($PLEASE_RENAME_TO_SMTH_DESCRIPTIVE->getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small thing. Also, could you please add changelogs into a PR description. I'll use it to release this PRs later
composer.json
Outdated
"open-telemetry/context": "^1.0", | ||
"open-telemetry/sem-conv": "^1.0", | ||
"php": ">=8.1", | ||
"spryker/rabbit-mq": "^2.19.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say we need a version, but we should not force people to update to the latest one. I would say ^2.0.0 is more then enough
Developer(s): @dimitriyTsemma
Ticket: https://spryker.atlassian.net/browse/FRW-8630
merge: squash
Release Table
Package OtelRabbitMqInstrumentation
Change log
Initial Release