kalgurn / github-rate-limits-prometheus-exporter

GitHub Rate Limits Prometheus exporter. Works with both App and PAT credentials
MIT License
14 stars 8 forks source link

metrics exported showing up as errors in gcp logs #97

Open jason-ford-codecov opened 2 months ago

jason-ford-codecov commented 2 months ago

Is there a way to change the level of logging for this app to not show up in gcp logs as an error? It fills up the logs.

jason-ford-codecov commented 2 months ago

AND, the finale of explanation: the default stream used by StreamHandler is stderr, which is rightly (IMHO) interpreted by google's logging reporting as "error."

https://stackoverflow.com/questions/65776399/why-is-my-gcp-function-logging-errors-that-should-be-info-or-debug

jason-ford-codecov commented 2 months ago

Unfortunately still an issue in February 2024. My workaround was to use a log format that GCP seems to parse more effectively. With logging.basicConfig I am setting the log format to the following u'{"message": "%(asctime)s %(module)s %(process)d %(thread)d %(message)s", "severity": "%(levelname)s", "time": "%(asctime)s"}'