From 09374d92aa53661b85a4e96fc07b358a032da0f6 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Thu, 17 Mar 2016 13:22:20 +0000 Subject: [PATCH] Remove anti-pattern of having target labels in instrumentation example. --- prometheus/examples_test.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/prometheus/examples_test.go b/prometheus/examples_test.go index 0344e46..4863b95 100644 --- a/prometheus/examples_test.go +++ b/prometheus/examples_test.go @@ -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"}, )