svenstaro / site24x7_exporter

A Prometheus compatible exporter for site24x7.com
MIT License
17 stars 7 forks source link

enabled support for RESTAPI monitors #339

Closed AlKapkone closed 7 months ago

AlKapkone commented 7 months ago

added support of REST API monitor type

svenstaro commented 7 months ago

Did you test this against a real setup?

AlKapkone commented 7 months ago

Tested locally and it's working as expected.

site24x7_monitor_latency_seconds{location="Amsterdam - NL",monitor_group="",monitor_name="example-api",monitor_type="RESTAPI"} 0.321
site24x7_monitor_latency_seconds{location="Amsterdam - NL",monitor_group="",monitor_name="example-front",monitor_type="URL"} 0.025
AlKapkone commented 7 months ago

Unfortunately, the command curl https://accounts.zoho.eu/oauth/v2/token -X POST @curl-secrets didn't work, so I used Postman for this purpose. Error: curl: (6) Could not resolve host: curl-secrets

AlKapkone commented 7 months ago

Postman usage:

Screenshot 2024-04-05 at 16 57 30
AlKapkone commented 7 months ago

    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/site24x7_exporter --site24x7-endpoint site24x7.eu`
14:02:20 [INFO] site24x7_exporter 1.0.1
14:02:20 [INFO] Using site24x7 endpoint: https://www.site24x7.eu/api
14:02:20 [INFO] Using Zoho endpoint: https://accounts.zoho.eu
14:02:20 [INFO] Not using any proxies
14:02:20 [INFO] Requesting access token from https://accounts.zoho.eu/oauth/v2/token
14:02:21 [INFO] Successfully acquired access token
14:02:26 [INFO] Serving metrics```
svenstaro commented 7 months ago

Could you rebase onto master please? That'll make the CI work.

svenstaro commented 7 months ago

Also please update the README and CHANGELOG.

AlKapkone commented 7 months ago

"Could you rebase onto master please? That'll make the CI work." Should I merge my feature branch into the main branch of my fork?

svenstaro commented 7 months ago

You should fetch upstream/origin and rebase your feature branch on top of that so that the CI may run.

AlKapkone commented 7 months ago

I got it, thanks, done. I missed that you made some fresh changes.

svenstaro commented 7 months ago

Also update the features section of the README.

svenstaro commented 7 months ago

And it would be great if you could rebase this down into one commit.

AlKapkone commented 7 months ago

Moved to https://github.com/svenstaro/site24x7_exporter/pull/342