jamesread / prometheus-gmail-exporter

Checks gmail labels for unread messages and exposes the counts via prometheus.
Apache License 2.0
47 stars 9 forks source link

Provide more Error Details when get_gmail_client() fails #3

Closed vorburger closed 1 year ago

vorburger commented 1 year ago

I'm toying with using this project (cool idea, thanks for publishing this!) but stuck at:

Traceback (most recent call last):
  File "/usr/local/sbin/gmail-exporter", line 267, in <module>
    main()
  File "/usr/local/sbin/gmail-exporter", line 236, in main
    GMAIL_CLIENT = get_gmail_client()"

Presumably this means the Gmail API connection fails? I'm a Python Noob, is it possible to somehow make this Traceback include more details about what failed? (Like a more nested Java Exception Stack Trace with Caused by: - or is that not really how Python typically propagates errors?)

I do have a ~/.prometheus-gmail-exporter/client_secret.json, so that in itself isn't the problem (I think).

I'm however not really running this in Podman/Docker with -v ~/.prometheus-gmail-exporter/:/root/.prometheus-gmail-exporter/ but starting the container "headlessly" using Google Cloud Run - which presumably should work just as well as on a Desktop, hopefully?

@jamesread

vorburger commented 1 year ago

I'm however not really running this in Podman/Docker with -v ~/.prometheus-gmail-exporter/:/root/.prometheus-gmail-exporter/ but starting the container "headlessly" using Google Cloud Run - which presumably should work just as well as on a Desktop, hopefully?

I meanwhile learnt more about this, and understood that this set-up actually cannot "just work".

I'll look into doing this differently.

Closing this.

jamesread commented 1 year ago

Hey @vorburger , just a quick note so say that I was going to test this myself, as I had some suspicions that this wasn't quite right.

If you'd like to talk more about getting this working, let me know :-) Very keen to support you!