Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
metrics: adds label override to example metrics server
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleterry committed Nov 14, 2019
1 parent 9965640 commit 00b489e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions instrumentation/examples/metrics_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ func (t testApp) ServeHTTP(w http.ResponseWriter, r *http.Request) {
random := rand.Intn(10)
<-time.After(time.Millisecond * time.Duration(random))
})

// label override
h := gcsTimer.Start()
random := rand.Intn(10)
<-time.After(time.Millisecond * time.Duration(random))
gcsTimer.ObserveDuration(h, metrics.NewLabel("backend", "backblaze"), metrics.NewLabel("action", "post"))
}

func main() {
Expand Down

0 comments on commit 00b489e

Please sign in to comment.