コード例 #1
0
ファイル: dnsmasq_full_logs.go プロジェクト: darron/goshe
// 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
ファイル: dnsmasq_signal_stats.go プロジェクト: darron/goshe
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
ファイル: dnsmasq_signal_stats.go プロジェクト: darron/goshe
// 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
}