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

Export isOpen() and metrics #21

Closed
isaldana opened this issue Mar 24, 2015 · 4 comments
Closed

Export isOpen() and metrics #21

isaldana opened this issue Mar 24, 2015 · 4 comments
Assignees

Comments

@isaldana
Copy link

We have a need to check if a circuit is open. Is there an easy way to do that? Also, we want to send some status to our metrics server and the only way I can think of is to hack the HTTP streamer. An example here (to stdout):

// This is  used to output the Hystrix stream to stdout and only used for debugging
// circuit stats
type outputResponseStdout struct {
    HeaderMap http.Header
}

func (o *outputResponseStdout) Header() http.Header {
    m := o.HeaderMap
    if m == nil {
        m = make(http.Header)
        o.HeaderMap = m
    }
    return m
}

func (o *outputResponseStdout) Write(buf []byte) (int, error) {
    return os.Stdout.Write(buf)
}

func (o *outputResponseStdout) WriteHeader(c int) {
    fmt.Println("HTTP code: ", c)
}

func OutputHystrixEvents() {
    s := hystrix.NewStreamHandler()
    s.Start()
    rh := &outputResponseStdout{}
    req, err := http.NewRequest("GET", "", nil)
    if err != nil {
        return
    }
    s.ServeHTTP(rh, req)
}
@kanekv kanekv mentioned this issue Mar 24, 2015
@afex
Copy link
Owner

afex commented Mar 24, 2015

@crxpandion is working on a patch introducing non-dashboard metrics (i.e. statsd)

@crxpandion
Copy link
Contributor

Yeah I am working on introducing a metrics interface that will allow pluggable aggregators.

@afex
Copy link
Owner

afex commented Apr 11, 2015

#25

@afex afex self-assigned this Apr 20, 2015
@afex
Copy link
Owner

afex commented Jun 2, 2015

statsd metrics are now possible in master, and there is a framework for your own implementation for custom solutions.

@afex afex closed this as completed Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants