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
Conversation
$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); |
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.
Does $response
need to get used somehow?
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.
It was just useful to print it out, let me remove from everywhere though, good idea
c1ccc02
to
b6d378a
Compare
caf9d48
to
cae7075
Compare
24922f1
to
79ae3fd
Compare
dc9e446
to
c6c3b53
Compare
5fdd340
to
a6c318d
Compare
…andboxed eloquent tests
…fining IS_SANDEBOXED
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.
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! ❤️
src/DDTrace/Integrations/Eloquent/EloquentSandboxedIntegration.php
Outdated
Show resolved
Hide resolved
src/DDTrace/Integrations/Eloquent/EloquentSandboxedIntegration.php
Outdated
Show resolved
Hide resolved
*/ | ||
public function setCommonValues(SpanData $span) | ||
{ | ||
$span->type = Type::SQL; |
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.
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;
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 catch @SammyK
|
||
protected function expectedServiceName() | ||
{ | ||
// Shouldn't this not be set by teh span encoder? |
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 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. :)
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.
Nailed it! 💅
Description
Readiness checklist
Reviewer checklist