Closed maddyblue closed 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())
...
}
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.
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 .
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.
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