Site24x7 prometheus exporter k8s charm


I’ve been working on a kubernetes charm for the site24x7 prometheus exporter, which lets you unify external end-to-end service monitoring with the rest of your metrics. Here’s how you can use it:


You will need to have 2-factor auth enabled for your Zoho account in order to generate the correct credentials:

  1. Set up a Self Client in the web interface (not any of the “Application” ones). This will provide you with the client_id and client_secret configuration settings.

  2. Go to your client’s Generate Code tab and create a temporary code with the Scope of Site24x7.Reports.Read and an expiration of 10 minutes. You can put whatever you like in the comment field, as this is just a temporary springboard to generate the real token.

  3. Use this temporary code and the id and secret from the other tab to fill out a file called curl-secrets (replacing the 0xDEADBEEF hex examples here with your credentials):


Then run curl -X POST -d @curl-secrets (adjusting for your regional zoho hostname). You will get a field back called refresh_token which you’ll combine with your client id and secret in the final step:


$ juju deploy cs:~prometheus-site24x7-exporter-charmers/site24x7-exporter --config client_id='1000.DEADBEEFDEADBEEFDEADBEEFDEADBE' --config client_secret='deadbeefdeadbeefdeadbeefdeadbeefdeadbeefde' --config refresh_token='1000.c0defacec0defacec0defacec0deface.c0defacec0defacec0defacec0deface'

Once the hooks have settled out, you should be able to browse curl http://${UNIT_IP:?}:9803/metrics on the relevant unit IP. You can register it as an endpoint in your prometheus server, and be able to graph those metrics.


There is a widely-reported issue whereby some Zoho accounts are able to use the refresh_token to get a temporary auth token, but requests under that token fail with HTTP 401 errors. If you encounter this, please follow up on the issue with information about your setup.


This charm aims to keep 100% test coverage. To run the test suite, simply run make test.