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

chore: upgrade dd-trace to v4.50.0 #590

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

nhulston
Copy link
Contributor

@nhulston nhulston commented Nov 20, 2024

What does this PR do?

Upgrades dd-trace to v4.50.0

Motivation

Load in new span pointer features: DataDog/dd-trace-js#4875

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@nhulston nhulston marked this pull request as ready for review November 20, 2024 19:32
@nhulston nhulston requested a review from a team as a code owner November 20, 2024 19:32
@@ -9,7 +9,7 @@

# 7 mb size limit
MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 7 \* 1024)
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 18 \* 1024)
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 19 \* 1024)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just as an aside. What's the point in checking the layer size if we're just gonna keep upping the limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question, I'm not sure. I guess to make sure we don't accidentally increase the size significantly without realizing?

@@ -48,7 +47,6 @@ START
"_inferred_span.tag_source": "self",
"_inferred_span.synchronicity": "sync",
"http.method": "GET",
"http.route":"/{proxy+}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we investigate why this tag moved from what looks like the inferred span to the invocation span?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the time of creating #584
I still had the issue of not being able to update the snapshots. So I added the original lines manually, and I must have put them in the wrong place even though the tests still passed.

It seems like they should be in the invocation span, not the inferred span.

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree. I think it should be on the inferred span since for an api.gateway span, that's where the idea of the routing is happening. Can we run these again and confirm where these tags are actually being added? This is the only trace out of all the test invocates in which it's been moved.

Copy link
Contributor Author

@nhulston nhulston Nov 22, 2024

Choose a reason for hiding this comment

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

The code that sets the http.route tags is here:

if (event.resource) {
httpTags["http.route"] = event.resource;
}
return httpTags;
}
if (eventType.isAPIGatewayEventV2(event)) {
const requestContext = event.requestContext;
httpTags["http.url"] = requestContext.domainName;
httpTags["http.url_details.path"] = requestContext.http.path;
httpTags["http.method"] = requestContext.http.method;
if (event.headers?.Referer) {
httpTags["http.referer"] = event.headers.Referer;
}
if (event.routeKey) {
// "GET /my/endpoint" => "/my/endpoint"
const array = event.routeKey.split(" ");
httpTags["http.route"] = array[array.length - 1];
}
return httpTags;

If you backtrack the call stack, it starts at onStartInvocation and stores the result in this.triggerTags, so at least according to the code, we are setting the tags on the Lambda span -- not the API GW inferred span.

More info: https://datadoghq.atlassian.net/browse/SVLS-5779

But maybe we should also be adding the http.route tags to the inferred span?

@@ -38,7 +38,6 @@ START
"_dd.p.tid": "XXXX",
"_dd.p.dm": "-0",
"service": "remappedApiGatewayServiceName",
"version": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we figure out why this was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. Looks like it's just removed on the inferred span, but not the aws.lambda spans.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that sounds fine then. I think it'll be important to make sure they remain on the aws.lambda span even if they're removed from the inferred span.

@nhulston nhulston force-pushed the nicholas.hulston/upgrade-dd-trace-4.50.0 branch from 1a6fedd to 1fd3596 Compare November 22, 2024 18:54
@nhulston nhulston merged commit 554ad98 into main Nov 22, 2024
25 checks passed
@nhulston nhulston deleted the nicholas.hulston/upgrade-dd-trace-4.50.0 branch November 22, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants