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

port-to-go: Finish getCredentials() implementation, and document usage #11

Open vorburger opened 1 year ago

vorburger commented 1 year ago

In the context of #10, I had a brief try at the port-to-go, but realized that its getCredentials() method does not appear to be fully implemented? @jamesread or am I just really dumb and not understanding how to use it? Perhaps this issue could track the implementation, and then document how the credz have to be obtained.

jamesread commented 1 year ago

Hey @vorburger , indeed this is still work in progress - I pushed the work I had done so far.

glynternet commented 1 year ago

Hi all,

I was following this repo from when looking for a gmail exporter myself a couple of years ago. I wasn't very good with python back then so implemented this go version: https://github.com/glynternet/gmail-exporter/tree/main

I didn't realise I hadn't open sourced it yet, so did so this morning. Added an MIT license. Feel free to use, reuse, adapt, contribute to etc. :smile:

It has a bit of a strange build system that I tried to start templatising for all of my projects but you should just be able to build and use it using go build cmd/gmail-exporter

jamesread commented 1 year ago

Hey @glynternet , wow, that's funny timing! :-) Thanks for sharing - will take a look at your codebase.

Are you interested in contributions? Maybe this project makes more sense to stay as python then, rather than re-inventing the wheel?

At the moment, with the last few days of updates I think this python version has become a lot more stable / usable for other people (it's been running fine for just me for quite some time) - so probably no need to throw the python version away now (which I was going to do). However, I do find go to be far more maintainable, if people start asking for more features.

glynternet commented 1 year ago

I'd be very open to contributions.

Admittedly the state of the repo is one I quickly whipped together so I'd probably look at improving it a bit more if people wanted to contribute.

Feel free to file issues over there if you ever want to discuss it 👍🏻

jamesread commented 1 year ago

Sounds great - probably won't be any time soon, it'll probably be if / when I get frustrated with this python implementation! But I won't try and re-invent the wheel if I decide a Go version is the way to go - will contribute back. Thanks for commenting here!