From 45738589f97de6bca7ffaac89e70880874ae05ec Mon Sep 17 00:00:00 2001 From: Dani Louca <59848726+dloucasfx@users.noreply.github.com> Date: Thu, 4 Nov 2021 16:07:55 -0400 Subject: [PATCH] Better logging for aws metadata (#1991) Signed-off-by: Dani Louca --- pkg/core/hostid/aws.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/core/hostid/aws.go b/pkg/core/hostid/aws.go index aefea95e1e..6ed8c6ae74 100644 --- a/pkg/core/hostid/aws.go +++ b/pkg/core/hostid/aws.go @@ -31,17 +31,11 @@ func AWSUniqueID(cloudMetadataTimeout timeutil.Duration) string { client := ec2metadata.New(sess) - // Checks whether it's an EC2 instance and Metadata service is available. - if !client.Available() { - log.Debug("No EC2 metadata server detected, assuming not on AWS EC2") - return "" - } - doc, err := client.GetInstanceIdentityDocument() if err != nil { log.WithFields(log.Fields{ - "error": err, - }).Error("Failed to get AWS instance-identity") + "detail": err, + }).Info("No AWS metadata server detected, assuming not on EC2") return "" }