kinduff / csgo_exporter

A Prometheus exporter for Counter-Strike: Global Offensive.
Apache License 2.0
19 stars 3 forks source link

Exporter is frequently crashing #55

Closed simonszu closed 11 months ago

simonszu commented 1 year ago

For some time now the exporter is frequently crashing, which causes an alert by prometheus. The log files show something like this:

time="2022-11-10T13:52:47Z" level=info msg="Sending HTTP request to https://api.steampowered.com/ISteamNews/GetNewsForApp/v0002?appid=730&key=[FILTERED]&maxlength=240"
time="2022-11-10T13:52:47Z" level=info msg="Sending HTTP request to https://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002?appid=730&key=[FILTERED]&steamid=76561197996581872"
time="2022-11-10T13:52:47Z" level=info msg="Sending HTTP request to https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001?appid=730&appids_filter%5B0%5D=730&key=[FILTERED]&steamid=76561197996581872"
time="2022-11-10T13:52:47Z" level=fatal msg="An error has occurred during retrieving statistics <nil>"
time="2022-11-10T13:53:48Z" level=info msg="============================================="
time="2022-11-10T13:53:48Z" level=info msg="         CSGO Exporter Configuration         "
time="2022-11-10T13:53:48Z" level=info msg="============================================="
time="2022-11-10T13:53:48Z" level=info msg="HTTPPort: 7355"
time="2022-11-10T13:53:48Z" level=info msg="SteamAPIKey: [FILTERED]"
time="2022-11-10T13:53:48Z" level=info msg="SteamID: 76561197996581872"
time="2022-11-10T13:53:48Z" level=info msg="FetchInventory: true"
time="2022-11-10T13:53:48Z" level=info msg="Currency: EUR"
time="2022-11-10T13:53:48Z" level=info msg="ScrapeInterval: 30s"
time="2022-11-10T13:53:48Z" level=info msg="============================================="
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: stats"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: last_match"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: total_shots"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: total_kills"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: total_hits"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: achievements"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: playtime"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: news"
time="2022-11-10T13:53:48Z" level=info msg="New Prometheus metric registered: user_inventory"
time="2022-11-10T13:53:48Z" level=info msg="Starting HTTP server on http://localhost:7355"

Do you have any idea why the error could occur? I did not change anything to my profile - maybe the steam API has changed? But then, only some requests fail, not all, that means the exporter is not crashing on every request.

kinduff commented 1 year ago

Will take a look, thanks for the report. I may need to add a debug flag in order to get more information about the exception, and could ask you for more information.

simonszu commented 1 year ago

Sure, always happy to help :D

phyzical commented 11 months ago

for future users simply just increase SCRAPE_INTERVAL the default is too aggressive it seems