Open
Description
Hi,
I am trying to run ec2 examples setup as explained here. But I am unable to run it successfully.
Below is the output
[ec2-user@ip-172-xx-xx-xx ec2]$ ./run-example.sh
Processing /home/ec2-user/aws-embedded-metrics-python
Requirement already satisfied: aiohttp in ./venv/lib/python3.7/site-packages (from aws-embedded-metrics==1.0.7) (3.7.4.post0)
Requirement already satisfied: yarl<2.0,>=1.0 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (1.6.3)
Requirement already satisfied: chardet<5.0,>=2.0 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (4.0.0)
Requirement already satisfied: async-timeout<4.0,>=3.0 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (3.0.1)
Requirement already satisfied: attrs>=17.3.0 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (20.3.0)
Requirement already satisfied: typing-extensions>=3.6.5 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (3.7.4.3)
Requirement already satisfied: multidict<7.0,>=4.5 in ./venv/lib/python3.7/site-packages (from aiohttp->aws-embedded-metrics==1.0.7) (5.1.0)
Requirement already satisfied: idna>=2.0 in ./venv/lib/python3.7/site-packages (from yarl<2.0,>=1.0->aiohttp->aws-embedded-metrics==1.0.7) (3.1)
Using legacy setup.py install for aws-embedded-metrics, since package 'wheel' is not installed.
Installing collected packages: aws-embedded-metrics
Attempting uninstall: aws-embedded-metrics
Found existing installation: aws-embedded-metrics 1.0.7
Uninstalling aws-embedded-metrics-1.0.7:
Successfully uninstalled aws-embedded-metrics-1.0.7
Running setup.py install for aws-embedded-metrics ... done
Successfully installed aws-embedded-metrics-1.0.7
~/aws-embedded-metrics-python/examples/ec2/metadata-endpoint ~/aws-embedded-metrics-python/examples/ec2
Sending build context to Docker daemon 4.096kB
Step 1/4 : FROM node:latest
---> d2850632b602
Step 2/4 : RUN npm install -g json-server
---> Using cache
---> 2efdece2d60d
Step 3/4 : COPY ./ec2-metadata.json /root/ec2-metadata.json
---> Using cache
---> 49031f96b031
Step 4/4 : ENTRYPOINT ["json-server", "/root/ec2-metadata.json"]
---> Using cache
---> 1689343eb22f
Successfully built 1689343eb22f
Successfully tagged ec2metadata:latest
9a741d69afc67e152decab903b50d524795f5cc4c057374436369d3e00cc7860
~/aws-embedded-metrics-python/examples/ec2
Waiting for endpoint to start.
EC2 Metadata Container started in: 9a741d69afc6.
Sending build context to Docker daemon 12.29kB
Step 1/8 : FROM debian:latest
---> 0d587dfbc4f4
Step 2/8 : RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
---> Using cache
---> b60931d58ca0
Step 3/8 : RUN curl -O https://amazon-cloud-watch-agent.s3.amazonaws.com/debian/amd64/1.237768.0/amazon-cloudwatch-agent.deb && dpkg -i -E amazon-cloudwatch-agent.deb && rm -rf /tmp/* && rm -rf /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard && rm -rf /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl && rm -rf /opt/aws/amazon-cloudwatch-agent/bin/config-downloader
---> Using cache
---> 8961059d1191
Step 4/8 : COPY ./.aws/amazon-cloudwatch-agent.json /opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json
---> Using cache
---> a5828ff01ef2
Step 5/8 : COPY ./.aws/config /root/.aws/config
---> 216ab88a3afc
Step 6/8 : COPY ./.aws/credentials /root/.aws/credentials
---> e7dd76b730ac
Step 7/8 : ENV RUN_IN_CONTAINER="True"
---> Running in 19963a1c1c30
Removing intermediate container 19963a1c1c30
---> ddc0519c1e7d
Step 8/8 : ENTRYPOINT ["/opt/aws/amazon-cloudwatch-agent/bin/start-amazon-cloudwatch-agent"]
---> Running in 7d8c332ab85a
Removing intermediate container 7d8c332ab85a
---> 7ec48d004bb3
Successfully built 7ec48d004bb3
Successfully tagged agent:latest
Waiting for agent to start.
2021/04/26 02:08:46 I! I! Detected the instance is EC2
2021/04/26 02:08:43 Reading json config file path: /opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json ...
Cannot access /etc/cwagentconfig: lstat /etc/cwagentconfig: no such file or directoryValid Json input schema.
2021/04/26 02:08:44 W! retry [0/3], unable to get http response from http://169.254.170.2/v2/metadata, error: unable to get response from http://169.254.170.2/v2/metadata, error: Get http://169.254.170.2/v2/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2021/04/26 02:08:45 W! retry [1/3], unable to get http response from http://169.254.170.2/v2/metadata, error: unable to get response from http://169.254.170.2/v2/metadata, error: Get http://169.254.170.2/v2/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2021/04/26 02:08:46 W! retry [2/3], unable to get http response from http://169.254.170.2/v2/metadata, error: unable to get response from http://169.254.170.2/v2/metadata, error: Get http://169.254.170.2/v2/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2021/04/26 02:08:46 E! getting information from ECS task metadata fail: unable to get response from http://169.254.170.2/v2/metadata, error: Get http://169.254.170.2/v2/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
No csm configuration found.
No metric configuration found.
Configuration validation first phase succeeded
2021/04/26 02:08:46 I! Config has been translated into TOML /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml
2021/04/26 02:08:46 I! AmazonCloudWatchAgent Version 1.237768.0.
2021-04-26T02:08:46Z D! Attempting connection to output: cloudwatchlogs
2021-04-26T02:08:46Z D! Successfully created credential sessions
2021-04-26T02:08:46Z D! Successfully connected to output: cloudwatchlogs
2021-04-26T02:08:46Z I! Starting AmazonCloudWatchAgent (version 1.237768.0)
2021-04-26T02:08:46Z I! Loaded outputs: cloudwatchlogs
2021-04-26T02:08:46Z I! Loaded inputs: socket_listener socket_listener
2021-04-26T02:08:46Z I! Tags enabled:
2021-04-26T02:08:46Z I! Agent Config: Interval:1m0s, Quiet:false, Hostname:"", Flush Interval:1s
2021-04-26T02:08:48Z D! Output [cloudwatchlogs] buffer fullness: 0 / 10000 metrics.
Agent started in container: a4942f59bd53.
INFO:aws_embedded_metrics.environment.environment_detector:Testing environment: LambdaEnvironment
INFO:aws_embedded_metrics.environment.environment_detector:Testing environment: EC2Environment
INFO:aws_embedded_metrics.environment.ec2_environment:Fetching EC2 metadata from: http://localhost:3000/ec2-metadata
INFO:aws_embedded_metrics.environment.ec2_environment:Failed to connect to EC2 metadata endpoint http://localhost:3000/ec2-metadata
INFO:aws_embedded_metrics.environment.environment_detector:No environment was detected. Using default.
INFO:aws_embedded_metrics.sinks.agent_sink:Parsed agent endpoint (udp) 0.0.0.0:25888
INFO:aws_embedded_metrics.sinks.udp_client:Submitted metrics to agent over UDP.
INFO:__main__:Example completed.
a4942f59bd53
a4942f59bd53
9a741d69afc6
9a741d69afc6