bosun-monitor / bosun

Time Series Alerting Framework
http://bosun.org
MIT License
3.4k stars 494 forks source link

[CLOSED] Put puts a metric on directly on the datapoint channel. #480

Closed maddyblue closed 9 years ago

maddyblue commented 9 years ago

Issue by kylebrandt Saturday Jul 19, 2014 at 15:24 GMT Originally opened as https://github.com/bosun-monitor/scollector/pull/46


This is useful for capturing "events" that have a gauge value


kylebrandt included the following code: https://github.com/bosun-monitor/scollector/pull/46/commits

maddyblue commented 9 years ago

Comment by kylebrandt Saturday Jul 19, 2014 at 15:25 GMT


Example usage:

func (s *Schedule) CheckAlert(r RunHistory, a *conf.Alert) {
    ...
    collect.Put("check.duration", opentsdb.TagSet{"name": a.Name}, time.Now().Unix(), time.Since(start).Seconds())
    ...
}
maddyblue commented 9 years ago

Comment by mjibson Monday Jul 21, 2014 at 14:37 GMT


I think this function is unsafe because it could be called twice within the same second and thus produce OpenTSDB data errors if the values differ between the two calls.

maddyblue commented 9 years ago

Comment by kylebrandt Monday Jul 21, 2014 at 16:16 GMT


Have a different idea? On Jul 21, 2014 10:37 AM, "Matt Jibson" notifications@github.com wrote:

I think this function is unsafe because it could be called twice within the same second and thus produce OpenTSDB data errors if the values differ between the two calls.

— Reply to this email directly or view it on GitHub https://github.com/StackExchange/scollector/pull/46#issuecomment-49613453 .

maddyblue commented 9 years ago

Comment by mjibson Monday Jul 21, 2014 at 16:55 GMT


Register a Set handler. This has the negative side effects that it can both miss events (if the sample rate isn't high enough) or report duplicate data (if it's sampled between events), but OpenTSDB isn't an event database, so we already have those problems when measuring events. I don't yet think this needs a new API call.

maddyblue commented 9 years ago

Comment by mjibson Wednesday Jul 23, 2014 at 17:13 GMT


LGTM