-
Notifications
You must be signed in to change notification settings - Fork 532
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
feat: Implement experimental AWS ECS resource attributes #1083
feat: Implement experimental AWS ECS resource attributes #1083
Conversation
e94077f
to
84aa245
Compare
Tagging @vasireddy99 and @bryan-aguilar to review this PR for it's changes to the AWS Resource Detectors. |
Hi @vasireddy99 and @bryan-aguilar, is there any news on this? We at Lumigo would love more fine-grained info about ECS Tasks to become available, and we'd be willing to do similar contributions for other SDKs. |
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
LGTM. waiting on component owner review from @NathanielRN or @willarmiros |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1083 +/- ##
==========================================
- Coverage 96.08% 95.67% -0.41%
==========================================
Files 14 20 +6
Lines 893 1157 +264
Branches 191 220 +29
==========================================
+ Hits 858 1107 +249
- Misses 35 50 +15
|
Ping @NathanielRN or @willarmiros |
Sorry for the delay on this, will take a look within the next week |
There's discussion on open-telemetry/opentelemetry-java#4574 (comment) whether the ARNs like the one this PR builds are actually correct. Until we are use, let's not merge :D |
Update: The uncertainty about ARNs seems sorted out |
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.
Tested this locally with the unit test's mocked TMDE response and the resource data looked good! Should be good to go once the CI merges.
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Show resolved
Hide resolved
@dyladan care to give it another look? Support for |
@willarmiros is the component owner this is OK to merge when he gives the 👍 |
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.
lgtm, I think just the error
needs a type to fix the linter :)
@dyladan - tagging to request your review/approval of this PR change |
Ah sorry I missed will's comment. i'll run the tests and merge this |
Please update the PR as an outdated PR cannot be merged. The tests are failing for an unrelated reason that I believe has been fixed since the last push on this PR. |
Implement the experimental AWS ECS resource attributes [1] using the Metadata v4 Endpoint. [1] https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/cloud_provider/aws/ecs/
ea3ea2c
to
3934441
Compare
@dyladan PR rebased. I also remove the trailing |
Would love to merge this, @mmanciop. We cannot merge out-of-date branch. Please update. It's best to allow changes from maintainers, so we can keep it up to date ourselves. That permission doesn't work with org-owned forks though. |
@rauno56 another branch update has happened :-) |
Cool... Thanks, I'll keep an eye on this and merge once CI greens. Please make future PRs from forks under your own account to make the process a little bit easier for us! 🙏 |
Do you think you could increase coverage across the diff at all? |
@rauno56 I’ll give it a shot |
@rauno56 I took a page off the AwsEks detector and used
|
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for the contribution!
@NathanielRN would you please have a look? |
@NathanielRN is no longer an approver - he should be removed from the CODEOWNERS on this repo. Either way we should not block on his review, this is good to be merged from my perspective. |
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.
Approving so no one blocks on my review!
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.
Sorry for adding this review so late.
Added a few comments, some of them are old issues that I saw during the review and are here mostly for discussion and not to fix as part of this PR.
None is blocker but could be nice to handle if you are up for it
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Show resolved
Hide resolved
if (hostName || containerId) { | ||
return new Resource({ | ||
[SemanticResourceAttributes.CONTAINER_NAME]: hostName || '', | ||
[SemanticResourceAttributes.CONTAINER_ID]: containerId || '', |
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.
Also here, I can see that the detector was and is using empty string when the value is unknown.
Wondering if it's cleaner to just not populate this attribute at all in this case 🤔
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 is done consistently like this in the various ECS detectors across the SDKs that have them. Not sure if it is an especially good practice tbh.
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Outdated
Show resolved
Hide resolved
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetector.ts
Show resolved
Hide resolved
@blumamir another round? |
Sorry for the delay. Thank you :) can you please rebase so I can merge? |
@blumamir done |
Which problem is this PR solving?
Short description of the changes
Checklist
npm run test-all-versions
for the edited package(s) on the latest commit if applicable.[1] https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/cloud_provider/aws/ecs/