-
Notifications
You must be signed in to change notification settings - Fork 230
feat: add S3 Bucket and Key params in instrumentation #3274
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
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.
This is looking great. Some comments below.
💚 CLA has been signed |
@@ -65,6 +67,16 @@ function instrumentationS3 (orig, origArguments, request, AWS, agent, { version, | |||
return orig.apply(request, origArguments) | |||
} | |||
|
|||
const otelAttrs = span._getOTelAttributes() |
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.
Oh, I misunderstood you when we discussed this earlier. I hadn't realized you were proposing dropping the if (bucket) { ... }
guard. I think I added confusion when I said I wasn't worried about the extra size at sending the empty otel: { attributes: {} }
in the seriliazed span. My bad.
I don't care strongly, but I think it would be nice to not send the empty otel: { attributes: {} }
for every ListBuckets
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.
I agree its better not to send empty properties in the span payload. For now Key
property should always come with Bucket
so putting back the attrs getter inside the if (bucket)
block is enough.
Maybe in the future we want to send other params that are not paired with a Bucket
so we will have to rethink the guard.
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.
Done! restored the guard and modified the tests to check we're not sending empty otel
Regarding that one test failure (https://github.com/elastic/apm-agent-nodejs/actions/runs/4745685401/jobs/8428356662?pr=3274). I have been noticing a lot of spurious test failures with GH Actions recently. We may have to discuss some strategy to deal with those at some point. For now I have been (a) just re-running the failed jobs manually and (b) trying to note the particular spurious tests (in a local file for now) to see if there is a pattern to which ones tend to be flaky. |
Oh, a thing I missed with my "approval": This should get a CHANGELOG.asciidoc entry as well. |
Co-authored-by: Trent Mick <[email protected]>
Added entry on changelog file :) |
This is the 3rd attempt that has a failed
I cannot reproduce on macos. Still trying to repro otherwise. |
I am able to repro via |
The test failures for node 18 will get fixed with #3281 |
Extract the parameters Bucket and Key from the instrumented requests to S3. Parameters are added into OTel attributes of the span following the OTel semconv spec Closes: elastic#3150
Extract the parameters
Bucket
andKey
from the instrumented requests to S3. Parameters are added into OTel attributes of the span following the specChecklist
Closes: #3150