Replace unicode chars
This commit is contained in:
12
README.md
12
README.md
@@ -12,9 +12,9 @@ The CSV reports the 24-hour uptime percentage for each CT log URL broken down by
|
|||||||
|
|
||||||
| Metric | Labels | Description |
|
| Metric | Labels | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `ct_log_uptime_ratio` | `log_url`, `endpoint` | 24h uptime as a ratio (0–1) |
|
| `ct_log_uptime_ratio` | `log_url`, `endpoint` | 24h uptime as a ratio (0-1) |
|
||||||
| `ct_log_uptime_fetch_success` | — | 1 if the last fetch succeeded, 0 otherwise |
|
| `ct_log_uptime_fetch_success` | | 1 if the last fetch succeeded, 0 otherwise |
|
||||||
| `ct_log_uptime_fetch_timestamp_seconds` | — | Unix timestamp of the last fetch attempt |
|
| `ct_log_uptime_fetch_timestamp_seconds` | | Unix timestamp of the last fetch attempt |
|
||||||
|
|
||||||
Standard `go_*` and `process_*` metrics are also exposed.
|
Standard `go_*` and `process_*` metrics are also exposed.
|
||||||
|
|
||||||
@@ -34,9 +34,9 @@ Metrics are served at `http://localhost:9781/metrics`.
|
|||||||
| `-listen` | `:9781` | Address to listen on |
|
| `-listen` | `:9781` | Address to listen on |
|
||||||
| `-url` | `https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv` | URL of the uptime CSV |
|
| `-url` | `https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv` | URL of the uptime CSV |
|
||||||
| `-interval` | `12h` | How often to fetch the CSV |
|
| `-interval` | `12h` | How often to fetch the CSV |
|
||||||
| `-jitter` | `5m` | Maximum ±jitter applied to the fetch interval |
|
| `-jitter` | `5m` | Maximum +/-jitter applied to the fetch interval |
|
||||||
|
|
||||||
The exporter fetches the CSV once on startup, then repeats every `-interval` ± a random value up to `-jitter`. This avoids thundering-herd effects if multiple instances run in parallel.
|
The exporter fetches the CSV once on startup, then repeats every `-interval` +/- a random value up to `-jitter`. This avoids thundering-herd effects if multiple instances run in parallel.
|
||||||
|
|
||||||
## Example Prometheus scrape config
|
## Example Prometheus scrape config
|
||||||
|
|
||||||
@@ -49,4 +49,4 @@ scrape_configs:
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Apache 2.0 — see [LICENSE](LICENSE).
|
Apache 2.0 - see [LICENSE](LICENSE).
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -28,7 +28,7 @@ func newExporter(reg prometheus.Registerer) *exporter {
|
|||||||
e := &exporter{
|
e := &exporter{
|
||||||
uptime: prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
uptime: prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||||
Name: "ct_log_uptime_ratio",
|
Name: "ct_log_uptime_ratio",
|
||||||
Help: "24h uptime ratio (0–1) for a CT log endpoint, sourced from gstatic.com.",
|
Help: "24h uptime ratio (0-1) for a CT log endpoint, sourced from gstatic.com.",
|
||||||
}, []string{"log_url", "endpoint"}),
|
}, []string{"log_url", "endpoint"}),
|
||||||
fetchOk: prometheus.NewGauge(prometheus.GaugeOpts{
|
fetchOk: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Name: "ct_log_uptime_fetch_success",
|
Name: "ct_log_uptime_fetch_success",
|
||||||
@@ -116,7 +116,7 @@ func main() {
|
|||||||
addr := flag.String("listen", ":9781", "address to listen on")
|
addr := flag.String("listen", ":9781", "address to listen on")
|
||||||
csvURL := flag.String("url", "https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv", "URL of the uptime CSV")
|
csvURL := flag.String("url", "https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv", "URL of the uptime CSV")
|
||||||
interval := flag.Duration("interval", 12*time.Hour, "how often to fetch the CSV")
|
interval := flag.Duration("interval", 12*time.Hour, "how often to fetch the CSV")
|
||||||
jitter := flag.Duration("jitter", 5*time.Minute, "maximum ±jitter applied to the fetch interval")
|
jitter := flag.Duration("jitter", 5*time.Minute, "maximum +/-jitter applied to the fetch interval")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
reg := prometheus.NewRegistry()
|
reg := prometheus.NewRegistry()
|
||||||
|
|||||||
Reference in New Issue
Block a user