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
Migrate memcached integration to sandboxed API #578
Conversation
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.
Great work @labbati! I know this is still a draft PR, but I left a little bit of early feedback. :)
|
||
namespace DDTrace\Integrations\Memcached; | ||
|
||
use DDTrace\Contracts\Span; |
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.
This isn't being referenced anywhere. :)
$this->traceCommand('touch'); | ||
$this->traceCommandByKey('touchByKey'); | ||
|
||
dd_trace_method('Memcached', 'flush', function (SpanData $span, $args) use ($integration) { |
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.
The $args
param can be removed :)
*/ | ||
public function setServerTagsByKey(SpanData $span, $memcached, $key) | ||
{ | ||
$server = $memcached->getServerByKey($key); |
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.
Since Memcached ::getServerByKey() can return false
, can add a check on the return value? Something like:
if (!is_array($server)) {
return;
}
I see this was migrated from the original integration so it would be great to update it there too. :)
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.
good catch 👍
8de154e
to
0626bed
Compare
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.
💥
Description
This PR migrates the memcached integration to the new awesome sandboxed api.
Readiness checklist
Reviewer checklist