Ejemplo n.º 1
0
func writeToHandlers(handlers []handler.Handler, metric metric.Metric) {
	for _, handler := range handlers {
		if canSendMetric(handler, metric) {
			handler.Channel() <- metric
		}
	}
}
Ejemplo n.º 2
0
func writeToHandlers(handlers []handler.Handler, metric metric.Metric) {
	for _, handler := range handlers {
		value, ok := metric.GetDimensionValue("collector")
		isBlackListed, _ := handler.IsCollectorBlackListed(value)
		if ok && isBlackListed {
			// This collector is black listed by
			// this handler. Therefore we are dropping this
			log.Debug("Not forwarding metrics from", value, "collector to", handler.Name(), "handler, since it has blacklisted this collector")
		} else {
			handler.Channel() <- metric
		}
	}
}