sergeyshevch / statuspage-exporter

Prometheus exporter for external status pages
MIT License
7 stars 8 forks source link

Version 3.0.0 Overhaul #26

Open fbuchmeier-abi opened 11 months ago

fbuchmeier-abi commented 11 months ago

Summary

Hi @sergeyshevch, I've made some fixes to your statuspage-exporter and the Helm Chart. I've also updated the client_timeout setting to use seconds instead of nanoseconds.

It would be great if you could take a look at the changes and give me feedback.

Thanks! Florian.

Version 3.0.0

⚠ BREAKING CHANGE

Features

Fixes

Details

Use correct port name for readiness and liveness probes, use correct endpoint to get health status

wrong port in Helm Chart:

  Warning  Unhealthy  17s (x9 over 73s)  kubelet            Readiness probe errored: strconv.Atoi: parsing "http": invalid syntax
  Warning  Unhealthy  17s (x6 over 67s)  kubelet            Liveness probe errored: strconv.Atoi: parsing "http": invalid syntax

wrong endpoints in Helm Chart:

  Warning  Unhealthy  77s (x3 over 97s)   kubelet            Liveness probe failed: HTTP probe failed with statuscode: 404
  Normal   Killing    77s                 kubelet            Container statuspage-exporter failed liveness probe, will be restarted
  Normal   Pulled     77s                 kubelet            Container image "ghcr.io/sergeyshevch/statuspage-exporter:2.0.0" already present on machine
  Normal   Started    76s (x2 over 106s)  kubelet            Started container statuspage-exporter
  Warning  Unhealthy  76s (x8 over 104s)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 404

https://github.com/sergeyshevch/statuspage-exporter/blob/main/main.go#L40

    srv.GET("/probe", prober.Handler(log))
    srv.GET("/healthz", handleHealthz)

Use seconds instead of nanoseconds for client_timeout for easier usability

Looking at the example config file, I suppose seconds where always the intended unit instead of nano-seconds:

### Configuration file example

```yaml
http_port: 9747
client_timeout: 2

https://pkg.go.dev/github.com/go-resty/resty#SetTimeout

https://pkg.go.dev/time#Duration

A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years.


Status getting mapped correctly

Beforce

# HELP service_status_fetch_duration_seconds Returns how long the service status fetch took to complete in seconds
# TYPE service_status_fetch_duration_seconds gauge
service_status_fetch_duration_seconds{status_page_url="https://www.githubstatus.com"} 0.253570119
# HELP statuspage_component Status of a service component. 0 - Unknown, 1 - Operational, 2 - Planned Maintenance, 3 - Degraded Performance, 4 - Partial Outage, 5 - Major Outage, 6 - Security Issue
# TYPE statuspage_component gauge
statuspage_component{component="API Requests",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Actions",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Codespaces",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Copilot",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Git Operations",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Issues",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Packages",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Pages",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Pull Requests",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Visit www.githubstatus.com for more information",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
statuspage_component{component="Webhooks",service="GitHub",status_page_url="https://www.githubstatus.com"} 0
# HELP statuspage_overall Overall status of a service0 - Unknown, 1 - Operational, 2 - Planned Maintenance, 3 - Degraded Performance, 4 - Partial Outage, 5 - Major Outage, 6 - Security Issue
# TYPE statuspage_overall gauge
statuspage_overall{service="GitHub",status_page_url="https://www.githubstatus.com"} 0

After

# HELP service_status_fetch_duration_seconds Returns how long the service status fetch took to complete in seconds
# TYPE service_status_fetch_duration_seconds gauge
service_status_fetch_duration_seconds{status_page_url="https://www.githubstatus.com"} 5.444317228
# HELP statuspage_component Status of a service component. 0 - Unknown, 1 - Operational, 2 - Planned Maintenance, 3 - Degraded Performance, 4 - Partial Outage, 5 - Major Outage, 6 - Security Issue
# TYPE statuspage_component gauge
statuspage_component{component="API Requests",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Actions",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Codespaces",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Copilot",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Git Operations",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Issues",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Packages",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Pages",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Pull Requests",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Visit www.githubstatus.com for more information",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
statuspage_component{component="Webhooks",service="GitHub",status_page_url="https://www.githubstatus.com"} 1
# HELP statuspage_overall Overall status of a service0 - Unknown, 1 - Operational, 2 - Planned Maintenance, 3 - Degraded Performance, 4 - Partial Outage, 5 - Major Outage, 6 - Security Issue
# TYPE statuspage_overall gauge
statuspage_overall{service="GitHub",status_page_url="https://www.githubstatus.com"} 0
sergeyshevch commented 11 months ago

@fbuchmeier-abi Hello! Thanks for your PR. I will look on it and merge during next week

fbuchmeier-abi commented 10 months ago

Hi @sergeyshevch ,

any news on the PR? Is there anything I can change / do?

Thanks! Florian.

fbuchmeier-abi commented 8 months ago

Hi @sergeyshevch,

any news from your side? Can I support you in any way?

Best regards, Florian.