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

Add AWS EC2 resource autodetection #20

Closed
fbogsany opened this issue Jul 8, 2020 · 5 comments
Closed

Add AWS EC2 resource autodetection #20

fbogsany opened this issue Jul 8, 2020 · 5 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fbogsany
Copy link
Contributor

fbogsany commented Jul 8, 2020

Follow on from open-telemetry/opentelemetry-ruby#230 and open-telemetry/opentelemetry-ruby#263.

@rydzykje
Copy link

I'm Ruby noob but will be happy to learn something and help with that.

@fbogsany
Copy link
Contributor Author

Thanks @rydzykje - I've assigned this to you.

@plantfansam
Copy link
Contributor

plantfansam commented May 10, 2021

I did a little research into this ticket, and I wanted to get some clarification before trying anything silly. Please forgive any naivete, as I'm new to Open Telemetry!

So this ticket differs from sibling GCP implementation in open-telemetry/opentelemetry-ruby#263 because Google Cloud provides a lovely Ruby gem that gives a lot of the data that the specification wants. As far as I can tell, there's no AWS equivalent to that GCP gem (would love to be wrong about this, though!). As a workaround, the JS EC2 detector hits the instance identity document endpoint to fill out the details of the resource.

This investigation makes me wonder a couple things:

  • The EC2 instance identity document is accessed via a link-local address. I'm concerned that an HTTP request to that link-local address might run very slowly in the event that this detector is run outside of an EC2 context. Is that a concern here? If so, is there an established method for dealing with that in this particular gem? The JS implementation seems to use async but that doesn't map cleanly to native Ruby functionality AFAIK.
  • AWS offers a lot a lot of different places to run code. EC2 is a big one, but Lambda, Fargate, and so on; these are all places that this gem might want to auto-detect. Should that be considered as part of this issue, or is that a separate thing?

@fbogsany
Copy link
Contributor Author

This issue is specifically about EC2, but we'd be happy to see contributions around any of those environments. If it's a ton of work to support all the environments, then delivering them one at a time is probably better, but otherwise a single PR covering all of them would be fine.

an HTTP request to that link-local address might run very slowly in the event that this detector is run outside of an EC2 context. Is that a concern here? If so, is there an established method for dealing with that in this particular gem?

We're planning to refactor the resource detectors gem to extract the GCP support to a separate gem. Other detectors should also be separate gems. That will allow users to only require the detectors for the environments they use and not suffer the performance penalty from other detectors.

@plantfansam
Copy link
Contributor

Ah, wonderful! Thanks so much for the clarification. I'll try to start with EC2 and see where it leads.

@plantfansam plantfansam transferred this issue from open-telemetry/opentelemetry-ruby Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants