Skip to content

Commit

Permalink
agent spec bypass proxy for cloud metadata (#785)
Browse files Browse the repository at this point in the history
* try to bypass proxy for metadata

* Apply suggestions from code review

Co-authored-by: Trent Mick <[email protected]>

* add more context why it makes sense

---------

Co-authored-by: Trent Mick <[email protected]>
  • Loading branch information
SylvainJuge and trentm authored Apr 19, 2023
1 parent 6b807a5 commit ecf4ce6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions specs/agents/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ Fetching of cloud metadata for services running as AWS Lambda functions follow a

[Metadata about an EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html) can be retrieved from the internal metadata endpoint, `http://169.254.169.254`.

In the case where a proxy is configured on the application, the agents SHOULD attempt to make
the calls to the metadata endpoint directly, without using the proxy.
This is recommended as those HTTP calls could be caller-sensitive and have to be made directly
by the virtual machine where the APM agent executes, also, the `169.254.x.x` IP address range
is reserved for "link-local" addresses that are not routed.

As an example with curl, first, an API token must be created

```sh
Expand Down Expand Up @@ -239,6 +245,12 @@ From the returned metadata, the following fields are useful
Metadata about a GCP machine instance can be retrieved from the
metadata service, `http://metadata.google.internal`.

In the case where a proxy is configured on the application, the agents SHOULD attempt to make
the calls to the metadata endpoint directly, without using the proxy.
This is recommended as those HTTP calls could be caller-sensitive and have to be made directly
by the virtual machine where the APM agent executes, also, the `169.254.x.x` IP address range
is reserved for "link-local" addresses that are not routed.

An example with curl

```sh
Expand All @@ -265,6 +277,12 @@ From the returned metadata, the following fields are useful
Metadata about an Azure VM can be retrieved from the internal metadata
endpoint, `http://169.254.169.254`.

In the case where a proxy is configured on the application, the agents SHOULD attempt to make
the calls to the metadata endpoint directly, without using the proxy.
This is recommended as those HTTP calls could be caller-sensitive and have to be made directly
by the virtual machine where the APM agent executes, also, the `169.254.x.x` IP address range
is reserved for "link-local" addresses that are not routed.

An example with curl

```sh
Expand Down

0 comments on commit ecf4ce6

Please sign in to comment.