Пример #1
0
// SendLineStats sends the stats to Datadog.
func SendLineStats(dog *statsd.Client, line string, metric string) {
	Log(fmt.Sprintf("%s: %s", metric, line), "debug")
	oldTags := dog.Tags
	dog.Tags = append(dog.Tags, fmt.Sprintf("record:%s", metric))
	dog.Count("dnsmasq.event", 1, dog.Tags, 1)
	dog.Tags = oldTags
}
Пример #2
0
func sendHistogramStats(metric string, value float64, additionalTag string, dog *statsd.Client) {
	tags := dog.Tags
	dog.Tags = append(dog.Tags, additionalTag)
	if os.Getenv("GOSHE_ADDITIONAL_TAGS") != "" {
		dog.Tags = append(dog.Tags, os.Getenv("GOSHE_ADDITIONAL_TAGS"))
	}
	dog.Histogram(metric, value, tags, 1)
	dog.Tags = tags
}
Пример #3
0
// sendQueriesStats actually sends the stats to Dogstatsd.
func sendQueriesStats(metric string, value int64, additionalTag string, dog *statsd.Client) {
	tags := dog.Tags
	dog.Tags = append(dog.Tags, additionalTag)
	if os.Getenv("GOSHE_ADDITIONAL_TAGS") != "" {
		dog.Tags = append(dog.Tags, os.Getenv("GOSHE_ADDITIONAL_TAGS"))
	}
	dog.Count(metric, value, tags, signalInterval)
	dog.Tags = tags
}