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

Migrate memcached integration to sandboxed API #578

Merged
merged 3 commits into from Sep 18, 2019

Conversation

labbati
Copy link
Member

@labbati labbati commented Sep 18, 2019

Description

This PR migrates the memcached integration to the new awesome sandboxed api.

Readiness checklist

  • (only for Members) Changelog has been added to the appropriate release draft. Create one if necessary.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.
  • Changelog has been added to the appropriate release draft. For community contributors the reviewer is in charge of this task.

@labbati labbati added 🎉 new-integration A new integration 🍏 core Changes to the core tracing functionality labels Sep 18, 2019
@labbati labbati added this to the 0.31.0 milestone Sep 18, 2019
@labbati labbati changed the base branch from master to labbati/sandboxing-eloquent September 18, 2019 13:21
Copy link
Contributor

@SammyK SammyK left a 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;
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍

@labbati labbati marked this pull request as ready for review September 18, 2019 17:32
@labbati labbati changed the base branch from labbati/sandboxing-eloquent to master September 18, 2019 17:33
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥

@SammyK SammyK merged commit c35e045 into master Sep 18, 2019
@labbati labbati deleted the labbati/sandboxing-memcached branch November 28, 2019 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍏 core Changes to the core tracing functionality 🎉 new-integration A new integration 📦 Sandbox API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants