Closed coolapso closed 1 month ago
seems to be not returning error properly, added a print just to peak at the response:
func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
channelsLive := make(map[string]bool)
streamsResp, err := e.client.GetStreams(&helix.StreamsParams{
UserLogins: *twitchChannel,
First: len(*twitchChannel),
})
fmt.Println(streamsResp)
if err != nil {
level.Error(e.logger).Log("msg", "Failed to collect stats from Twitch helix API", "err", err)
return
}
yelds the following result:
&{{401 map[Content-Length:[69] Content-Type:[application/json; charset=utf-8] Date:[Sat, 20 Jul 2024 14:56:34 GMT] Strict-Transport-Security:[max-age=300] Timing-Allow-Origin:[https://www.twitch.tv] Vary:[Accept-Encoding, Origin] X-Cache:[MISS, MISS] X-Cache-Hits:[0, 0] X-Served-By:[cache-bfi-kbfi7400114-BFI, cache-bma1627-BMA] X-Timer:[S1721487394.244472,VS0,VS0,VE157]] Unauthorized 401 Invalid OAuth token} {[] {}}}
believe this happens because the request is successful therefore err != null
... probably should log if response is not 200
Twitch exporter seems to not collect any metrics nor throw any logs. It also seems to be ignoring some flags as setting
--log.level debug
results in no extra logs and output seems to confirm so.Metrics:
For this I seem to have no clue where to start looking, would appreciate some help, ill be happy to work on it.