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

Error Encountered When Pulling AWS Resource Metrics #245

Open
pkumarsingh opened this issue Sep 10, 2020 · 3 comments
Open

Error Encountered When Pulling AWS Resource Metrics #245

pkumarsingh opened this issue Sep 10, 2020 · 3 comments

Comments

@pkumarsingh
Copy link

pkumarsingh commented Sep 10, 2020

Hi There,

I am trying to use YACE exporter to fetch metrics from different AWS region.
While executing docker command to fetch apigateway resource metrics from multiple AWS region, YACE exporter is throwing below error:

Digest: sha256:a6a1ab925f2b03bcfc1bc5055535beb1d444d223cf8ddbe50c36f18fc712570d
Status: Downloaded newer image for quay.io/invisionag/yet-another-cloudwatch-exporter:v0.20.0-alpha
{"level":"info","msg":"Parse config..","time":"2020-09-10T15:42:39Z"}
{"level":"info","msg":"Startup completed","time":"2020-09-10T15:42:39Z"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd53ef7]

goroutine 9 [running]:
main.detectDimensionsByService(0xc00001f480, 0xc000519240, 0xc0003a8b80, 0xc, 0x10)
/opt/aws_cloudwatch.go:513 +0x2527
main.scrapeDiscoveryJobUsingMetricData(0xc00001e440, 0x4, 0x4, 0xc000024220, 0xa, 0xc00004a670, 0x1, 0x1, 0x0, 0x0, ...)
/opt/abstract.go:203 +0xc28
main.scrapeAwsData.func1(0xc0000243c0, 0x0, 0xc000328000, 0x1, 0x1, 0x0, 0x0, 0x0, 0xc0000243b8, 0xc00000c6e0, ...)
/opt/abstract.go:46 +0x317
created by main.scrapeAwsData
/opt/abstract.go:32 +0x642

Below is the docker command:
docker run -it --rm -v /home/ubuntu/monitoring/yace/aws-cred:/exporter/.aws/credentials -p 5000:5000 --name yace -v /home/ubuntu/monitoring/yace/config.yml:/root/config.yml quay.io/invisionag/yet-another-cloudwatch-exporter:v0.20.0-alpha

This error is coming when fetching metrics from eu-west-1 region in my AWS account.
Looking forward for the fix.

@pkumarsingh
Copy link
Author

Any help would be appreciated :)

@jylitalo
Copy link
Contributor

jylitalo commented Sep 17, 2020

Just as a comment that details in panic() would point towards https://github.com/ivx/yet-another-cloudwatch-exporter/blob/bb2645ebcd402a43f5b2dbf477c81347a34adefa/aws_cloudwatch.go#L513 where the only real pointer is that
resource.Matcher. But I haven't played enough with API Gateways to be able to say why the Matcher is missing from there.
If you are willing to compile your own yace docker image, you could try something like this (just before line 513):

	if resource.Matcher == nil {
		log.Warningf("Matcher missing from %s ARN on %s service", resourceArn, *service)
		return dimensions
	}

It wouldn't solve the case, but it would give you some additional information for further debugging.

@udhos
Copy link
Contributor

udhos commented Sep 18, 2020

Please see this fixed bug #246

It is fixed on master.

Can you test it by building from master?

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

3 participants