summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-02-16 06:47:51 -0800
committerJoram Wilander <jwawilander@gmail.com>2018-02-16 09:47:51 -0500
commit6d8f122a5160f6d9e4c51579f2429dfaa62c7271 (patch)
tree6e0242cd6709260abd74060a7ec7dc1381efa36e /vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go
parentb112747de76f9c11c4d8083207049fac6e435019 (diff)
downloadchat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.gz
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.bz2
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.zip
Upgrading server dependancies (#8308)
Diffstat (limited to 'vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go')
-rw-r--r--vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go b/vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go
index 7e0ac66a5..fa5549a9e 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/push/examples_test.go
@@ -20,17 +20,16 @@ import (
"github.com/prometheus/client_golang/prometheus/push"
)
-func ExampleCollectors() {
+func ExamplePusher_Push() {
completionTime := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "db_backup_last_completion_timestamp_seconds",
Help: "The timestamp of the last successful completion of a DB backup.",
})
completionTime.SetToCurrentTime()
- if err := push.Collectors(
- "db_backup", push.HostnameGroupingKey(),
- "http://pushgateway:9091",
- completionTime,
- ); err != nil {
+ if err := push.New("http://pushgateway:9091", "db_backup").
+ Collector(completionTime).
+ Grouping("db", "customers").
+ Push(); err != nil {
fmt.Println("Could not push completion time to Pushgateway:", err)
}
}