Merge pull request #195 from prometheus/badlabel
Remove anti-pattern of having target labels in instrumentation example.
This commit is contained in:
commit
90c15b5efa
|
@ -14,7 +14,6 @@
|
|||
package prometheus_test
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
|
@ -48,16 +47,12 @@ func ExampleGauge() {
|
|||
}
|
||||
|
||||
func ExampleGaugeVec() {
|
||||
binaryVersion := flag.String("binary_version", "debug", "Version of the binary: debug, canary, production.")
|
||||
flag.Parse()
|
||||
|
||||
opsQueued := prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
Namespace: "our_company",
|
||||
Subsystem: "blob_storage",
|
||||
Name: "ops_queued",
|
||||
Help: "Number of blob storage operations waiting to be processed, partitioned by user and type.",
|
||||
ConstLabels: prometheus.Labels{"binary_version": *binaryVersion},
|
||||
},
|
||||
[]string{
|
||||
// Which user has requested the operation?
|
||||
|
@ -125,14 +120,10 @@ func ExampleCounter() {
|
|||
}
|
||||
|
||||
func ExampleCounterVec() {
|
||||
binaryVersion := flag.String("environment", "test", "Execution environment: test, staging, production.")
|
||||
flag.Parse()
|
||||
|
||||
httpReqs := prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Name: "http_requests_total",
|
||||
Help: "How many HTTP requests processed, partitioned by status code and HTTP method.",
|
||||
ConstLabels: prometheus.Labels{"env": *binaryVersion},
|
||||
},
|
||||
[]string{"code", "method"},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue