Demo entry 6353877

scopes

   

Submitted by anonymous on Apr 03, 2017 at 21:20
Language: Go. Code size: 406 Bytes.

scope, _ := tally.NewScope(tally.Opts{
    Prefix:   "app",
    Reporter: promReporter,
}, timer.Second)

helloScope := scope.Tagged(map[string]string{
    "path": "/hello",
})

authcScope := helloScope.Subscope("authc")
authcScope.Counter("ok").Increment(1)

authzScope := helloScope.Subscope("authz")
authzScope.Counter("granted").Increment(1)

helloScope.Counter("handled").Increment(1)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).