Remove anti-pattern of having target labels in instrumentation example.

This commit is contained in:
Brian Brazil 2016-03-17 13:22:20 +00:00
parent 18acf9993a
commit 09374d92aa
1 changed files with 0 additions and 9 deletions

View File

@ -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"},
)