githubexporter / github-exporter

:octocat: Prometheus exporter for github metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic when token has no access to outside collaborators

gionn opened this issue · comments

{"level":"info","msg":"Initialising capture of metrics","time":"2021-09-29T07:52:59Z"}
{"level":"info","msg":"Gathering metrics for GitHub Org cloudesire","time":"2021-09-29T07:52:59Z"}
{"level":"error","msg":"Error listing members by org: GET https://api.github.com/orgs/cloudesire/outside_collaborators?per_page=100: 403 You must be an owner of this organization to list outside collaborators. []","time":"2021-09-29T07:53:05Z"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x8a1718]

goroutine 15 [running]:
github.com/infinityworks/github-exporter/exporter.(*Exporter).Collect(0xc00011e000, 0xc000053140)
	/go/src/github.com/infinityworks/github-exporter/exporter/gather.go:56 +0x1e8
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
	/go/src/github.com/infinityworks/github-exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:444 +0x19d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
	/go/src/github.com/infinityworks/github-exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:536 +0xe36