aws / aws/amazon-cloudwatch-agent

OnPremise - Incorrect hostname when device behind a wifi network login page.

Open
#184 5 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

We have installed the agent on a device located on a wifi network that redirects to a login page before allowing access to the network.

What I believe is happening - First the agent checks to see if it's an EC2 instance by trying to hit the meta-data service, but the local network is redirecting this request to a login page. The **_entire contents_** of this page is then saved as the device hostname.

We are using the hostname within our log-group name. So then an error is thrown when trying to create the log group because the name limit is 512 characters and the content of the web page is _much_ longer than that.

Potential solution - Parse the returned page to make sure it is the ec2 meta-data service that is responding.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the agent's EC2 metadata hostname lookup and reproduce the behavior on a Wi-Fi captive portal. Verify how the returned response is handled, then confirm that a non-metadata response is not used as the hostname and that log-group creation no longer receives an oversized name.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.