Skip to content

Commit

Permalink
add 'avg_uptime' gague
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-deboer committed Nov 16, 2016
1 parent ab8b887 commit cad1a2c
Show file tree
Hide file tree
Showing 29 changed files with 4,583 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ release: clean
-a -tags netgo \
-ldflags "-X main.Version=$(VERSION)" \
-o bin/$(TARGET) .
docker build -t gettyimages/$(TARGET):$(VERSION) .

publish: release
docker build -t gettyimages/$(TARGET):$(VERSION) .
docker push gettyimages/$(TARGET):$(VERSION)
docker tag gettyimages/$(TARGET):$(VERSION) gettyimages/$(TARGET):latest
docker push gettyimages/$(TARGET):latest
Expand Down
3 changes: 2 additions & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
}

func (e *Exporter) exportApps(ch chan<- prometheus.Metric) (err error) {
content, err := e.scraper.Scrape("v2/apps")
content, err := e.scraper.Scrape("v2/apps?embed=apps.taskStats")
if err != nil {
log.Debugf("Problem scraping v2/apps endpoint: %v\n", err)
return
Expand Down Expand Up @@ -132,6 +132,7 @@ func (e *Exporter) scrapeApps(json *gabs.Container, ch chan<- prometheus.Metric)
"mem_in_mb": "mem",
"disk_in_mb": "disk",
"gpus": "gpus",
"avg_uptime": "taskStats.startedAfterLastScaling.stats.lifeTime.averageSeconds",
}

for _, app := range elements {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/url"
"time"

"github.com/gambol99/go-marathon"
"github.com/matt-deboer/go-marathon"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
)
Expand Down
40 changes: 40 additions & 0 deletions vendor/github.com/matt-deboer/go-marathon/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions vendor/github.com/matt-deboer/go-marathon/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/github.com/matt-deboer/go-marathon/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cad1a2c

Please sign in to comment.