Skip to content

Commit

Permalink
Merge pull request #122 from sapcc/high-drift-label
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Sep 10, 2024
2 parents 539a5c7 + f20b486 commit e30f9e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## v2.7.0 - TBD
## v2.8.0 - TBD

Changes:

## v2.7.0 - 2024-09-10

Changes:
- Renamed the `high-drift` query string in variable mode to `high_drift`. This makes it easies to use with Prometheus which does not accept dashes in label names.

## v2.6.1 - 2024-07-08

Changes:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ request:
- `target`: NTP server to use
- `protocol`: NTP protocol version (2, 3 or 4)
- `duration`: duration of measurements in case of high drift
- `high-drift`: High drift threshold to trigger multiple probing
- `high_drift`: High drift threshold to trigger multiple probing

For example:

```sh
$ curl 'http://localhost:9559/metrics?target=ntp.example.com&protocol=4&duration=10s&high-drift=100ms'
$ curl 'http://localhost:9559/metrics?target=ntp.example.com&protocol=4&duration=10s&high_drift=100ms'
```

## Frequently asked questions (FAQ)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func handlerMetrics(w http.ResponseWriter, r *http.Request) {
return
}

if u, err := time.ParseDuration(r.URL.Query().Get("high-drift")); err == nil {
if u, err := time.ParseDuration(r.URL.Query().Get("high_drift")); err == nil {
hd = u
} else {
http.Error(w, err.Error(), http.StatusBadRequest)
Expand Down

0 comments on commit e30f9e2

Please sign in to comment.