aws-observability/aws-otel-go

Using the EKS Resource detector

christopher-wong opened this issue ยท 4 comments

Hi there ๐Ÿ‘‹

I'm following the docs https://aws-otel.github.io/docs/getting-started/go-sdk#using-aws-eks-resource-detector to setup the EKS Resource detector but am running into some issues.

// Instantiate a new EKS Resource detector
eksResourceDetector := new(eks.ResourceDetector)

seems to return nil.

What's the proper way of instantiating this?

I think the docs mentioned the correct way of instantiating EKS detector. Are you running this on EKS or non EKS environment? This method (https://github.com/open-telemetry/opentelemetry-go-contrib/blob/master/detectors/aws/eks/detector.go#L73) might have returned nil in multiple cases.

// Instantiate a new EKS Resource detector
eksResourceDetector := new(eks.ResourceDetector)
resource, err := eksResourceDetector.Detect(context.Background())

Hi @christopher-wong ,

I submitted a fix for EKS here. This should solve the bad reference issue. Once the fix is merged to upstream will update the documentation as well. Feel free to test it out from my branch and see if this resolves your issue. Thanks!

Fantastic, thanks so much for looking into this. Sorry, I didn't see your earlier comment. I'll give this a try and report back!

This fix is rolled out in recent release - https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.17.0 so closing this issue. Feel free to open new one if the issue still exists!