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 eloquent integration to sandboxed API #559

Merged
merged 10 commits into from Sep 18, 2019

Conversation

labbati
Copy link
Member

@labbati labbati commented Sep 9, 2019

Description

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 changed the base branch from master to sammyk/sandboxed-pdo September 9, 2019 11:09
$this->connection()->exec("insert into users (email) VALUES ('test-user-updated@email.com')");
$traces = $this->tracesFromWebRequest(function () {
$spec = GetSpec::create('Eloquent update', '/eloquent/update');
$response = $this->call($spec);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does $response need to get used somehow?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was just useful to print it out, let me remove from everywhere though, good idea

@SammyK SammyK force-pushed the sammyk/sandboxed-pdo branch 3 times, most recently from c1ccc02 to b6d378a Compare September 9, 2019 15:06
@SammyK SammyK force-pushed the sammyk/sandboxed-pdo branch 4 times, most recently from 24922f1 to 79ae3fd Compare September 11, 2019 16:15
@labbati labbati force-pushed the labbati/sandboxing-eloquent branch 2 times, most recently from dc9e446 to c6c3b53 Compare September 18, 2019 06:28
@labbati labbati changed the base branch from sammyk/sandboxed-pdo to master_disabled_pdo September 18, 2019 06:29
@labbati labbati changed the base branch from master_disabled_pdo to master September 18, 2019 06:29
@labbati labbati changed the title Migrating Eloquent integration to Sandboxed API Migrate eloquent integration to sandboxed API Sep 18, 2019
@labbati labbati marked this pull request as ready for review September 18, 2019 12:32
@labbati labbati added this to the 0.31.0 milestone Sep 18, 2019
@labbati labbati added 🎉 new-integration A new integration 🍏 core Changes to the core tracing functionality labels Sep 18, 2019
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.

Fantastic sandboxed integration, @labbati! I really love how much cleaner you made the tests overall.

I have a few small tweaks but the main thing was making sure the service name gets set in the sandboxed integration. The Agent drops any spans that are missing the service name. But other than that, this PR is totally on point! ❤️

.circleci/config.yml Show resolved Hide resolved
tests/Common/IntegrationTestCase.php Show resolved Hide resolved
tests/Common/WebFrameworkTestCase.php Show resolved Hide resolved
*/
public function setCommonValues(SpanData $span)
{
$span->type = Type::SQL;
Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing the service name here. We'll need to add something similar to this method as a static method and then add:

$span->service = EloquentSandboxedIntegration::getAppName();

Or grab it in the constructor to reduce the number of method calls and then we could just do something like:

$span->service = $this->serviceName;

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch @SammyK


protected function expectedServiceName()
{
// Shouldn't this not be set by teh span encoder?
Copy link
Contributor

Choose a reason for hiding this comment

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

The SpanEncoder is only used for userland spans. C-level spans run through the serializer. Once we get the service name worked out (from the earlier comment) the service names should be the same for sandboxed and non-sandboxed integrations. :)

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.

Nailed it! 💅

@labbati labbati merged commit 8c3ba51 into master Sep 18, 2019
@labbati labbati deleted the labbati/sandboxing-eloquent 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

3 participants