Skip to content

Commit

Permalink
Merge pull request #18 from criteo-forks/gauge
Browse files Browse the repository at this point in the history
Support marathon 1.5+
  • Loading branch information
mapitman authored Oct 30, 2018
2 parents bdd3abd + 3de19b4 commit da19ac2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ A [Prometheus](http://prometheus.io) metrics exporter for the [Marathon](https:/

This exporter exposes Marathon's Codahale/Dropwizard metrics via its `/metrics` endpoint. To learn more, visit the [Marathon metrics doc](http://mesosphere.github.io/marathon/docs/metrics.html).

Note: version v1.5.1+ of this exporter is not compatible with marathon 1.4.0 and below.

## Getting

```sh
Expand Down
2 changes: 1 addition & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (e *Exporter) scrapeGauges(json *gabs.Container) {
}

func (e *Exporter) scrapeGauge(key string, json *gabs.Container) (bool, error) {
data := json.Path("value").Data()
data := json.Path("max").Data()
value, ok := data.(float64)
if !ok {
return false, errors.New(fmt.Sprintf("Bad conversion! Unexpected value \"%v\" for gauge %s\n", data, key))
Expand Down
8 changes: 4 additions & 4 deletions exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func Test_export_gauges(t *testing.T) {

results, err := te.export(`{
"gauges": {
"foo_value": {"value": 1},
"bar_value": {"value": 2}
"foo_value": {"min": 0, "max": 1},
"bar_value": {"min": 0, "max": 2}
}
}`)

Expand All @@ -188,8 +188,8 @@ func Test_export_gauges(t *testing.T) {

results, err = te.export(`{
"gauges": {
"foo_value": {"value": 1},
"baz_value": {"value": 3}
"foo_value": {"min": 0, "max": 1},
"baz_value": {"min": 0, "max": 3}
}
}`)

Expand Down

0 comments on commit da19ac2

Please sign in to comment.