Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS resource detector crash #16

Closed
bonclay7 opened this issue Jan 28, 2021 · 3 comments
Closed

ECS resource detector crash #16

bonclay7 opened this issue Jan 28, 2021 · 3 comments
Assignees

Comments

@bonclay7
Copy link
Member

Hello !

This is similar to #11. Using the ecs detector like this:

ecsResourceDetector := new(ecs.ResourceDetector)
resource, err := ecsResourceDetector.Detect(ctx)

if err != nil {
	fmt.Println("ECS Resource detection error:", err)
}

So, running on EC2 returns an error as expected, process is not on ECS, cannot detect environment variables from ECS.
However on ECS, there is no error, and the application crash with the following logs

image

@bhautikpip
Copy link
Contributor

Hi @bonclay7 ,

Thanks for opening an issue. I tried to take a look at this issue. From the logs you posted I think the you're receiving an error when detector is trying to get host name (https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/aws/ecs/ecs.go#L72). I also submitted a pull request to add error message in this scenario as well (open-telemetry/opentelemetry-go-contrib#568). Ideally from the code looks like even if resource detector is not able to find container name or container id it should return empty resource and not crashing. Are you still experiencing this issue? If yes, would you provide detailed repro steps so that I can reproduce on my end for better debugging and see what's going on.

@bonclay7
Copy link
Member Author

bonclay7 commented Feb 8, 2021

Hi ! Tried the Fix above and it's working fine. Can't wait for the next release

open-telemetry/opentelemetry-go-contrib#569 (comment)

@bhautikpip
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants