Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hystrix Metrics Collector for Expvar backend #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpastoor
Copy link

Similar as the plugins for Datadog, Graphite & StatsD I have created a collector who publishes the metrics in the expvar struct so it is available at /debug/vars.

I'm quite new at golang so feedback is welcome. (Maybe idea's how to write proper tests for this?)

To enable:

    c, _ := plugins.InitializeExpvarCollector(&plugins.ExpvarCollectorConfig{
        Prefix: "result0",
    })

    metricCollector.Registry.Register(c.NewExpvarCollector)

Added to expvar is a flat series of metrics per circuit breaker:

{
...
prefixname.circuitname.attempts: 2180,
prefixname.circuitname.circuitOpen: 1,
prefixname.circuitname.errors: 2089,
prefixname.circuitname.failures: 0,
prefixname.circuitname.fallbackFailures: 2089,
prefixname.circuitname.fallbackSuccesses: 0,
prefixname.circuitname.rejects: 248,
prefixname.circuitname.runDuration: 0,
prefixname.circuitname.shortCircuits: 1841,
prefixname.circuitname.successes: 91,
prefixname.circuitname.timeouts: 0,
prefixname.circuitname.totalDuration: 10.040859299999978,
...
}

@jpastoor
Copy link
Author

Travis Error seems unrelated to my patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant