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

opentelemetry-aws: add LambdaResourceDetector #93

Conversation

thomasgouveia
Copy link
Contributor

@thomasgouveia thomasgouveia commented Jul 22, 2024

Changes

This PR introduces the LambdaResourceDetector, which can detect resource attributes from an AWS Lambda environment. A new feature flag has been introduced detector-aws-lambda to hide this code when it is not needed.

It is based on the Go implementation.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

Part of #94

@thomasgouveia thomasgouveia requested a review from a team July 22, 2024 14:30
Copy link

linux-foundation-easycla bot commented Jul 22, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

…to detect resource attributes from an AWS Lambda environment.

This commits introduces the `LambdaResourceDetector`, that can be used to detect resource attributes from an AWS Lambda environment.
A new feature flag has been introduced `aws-lambda` to hide this code when it is not needed.

Signed-off-by: thomas.gouveia <[email protected]>
Signed-off-by: thomasgouveia <[email protected]>
@thomasgouveia thomasgouveia force-pushed the f-add-aws-lambda-resource-detector branch from 18a47ab to 75edc86 Compare July 22, 2024 14:31
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. I'd request to make this either a standalone crate in this repo, or part of https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-aws

We want to keep any platform specific (AWS/Azure/GCP etc.) outside of the detectors to better ensure ownership, maintenance in the future.

@thomasgouveia
Copy link
Contributor Author

thomasgouveia commented Jul 22, 2024

Hi @cijothomas , no problem, I understand and agree with that vision. What do you think of adding a detector module under opentelemetry-aws? Or should detectors be part of an external crate, such opentelemetry-aws-resource-detectors ?

@cijothomas
Copy link
Member

Hi @cijothomas , no problem, I understand and agree with that vision. What do you think of adding a detector module under opentelemetry-aws? Or should detectors be part of an external crate, such opentelemetry-aws-resource-detectors ?

I am unsure if there is any owner for opentelemetry-aws, as it was ported over from the main repo to this repo. We haven't yet established a process for allowing people to own individual crates. I think its best to start by putting detectors inside opentelemetry-aws crate itself for now. (Once we establish a more formal process for ownership, we can extract it to own crate, should the future owners decide to)

@thomasgouveia
Copy link
Contributor Author

@cijothomas Ok LGTM. I'll do it asap. Thanks!

@thomasgouveia thomasgouveia changed the title opentelemetry-resource-detectors: add LambdaResourceDetector opentelemetry-aws: add LambdaResourceDetector Jul 23, 2024
@thomasgouveia thomasgouveia requested a review from cijothomas July 23, 2024 07:20
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.4%. Comparing base (56a6f45) to head (7320c0d).
Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #93     +/-   ##
=======================================
+ Coverage   52.3%   56.4%   +4.1%     
=======================================
  Files         38      39      +1     
  Lines       4967    5429    +462     
=======================================
+ Hits        2598    3064    +466     
+ Misses      2369    2365      -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cijothomas cijothomas merged commit 9cd566b into open-telemetry:main Jul 26, 2024
9 checks passed
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.

3 participants