feature(collectors): Added services to collectorLabels and requests Countervec to capture the name of the kubernetes service used to serve the client request.

This commit is contained in:
Sergio Morales 2019-05-24 17:23:57 -04:00
parent ce418168f4
commit c38c66e00a

View file

@ -169,7 +169,7 @@ func NewSocketCollector(pod, namespace, class string, metricsPerHost bool) (*Soc
Namespace: PrometheusNamespace, Namespace: PrometheusNamespace,
ConstLabels: constLabels, ConstLabels: constLabels,
}, },
[]string{"ingress", "namespace", "status"}, []string{"ingress", "namespace", "status", "service"},
), ),
bytesSent: prometheus.NewHistogramVec( bytesSent: prometheus.NewHistogramVec(
@ -243,6 +243,7 @@ func (sc *SocketCollector) handleMessage(msg []byte) {
"namespace": stats.Namespace, "namespace": stats.Namespace,
"ingress": stats.Ingress, "ingress": stats.Ingress,
"status": stats.Status, "status": stats.Status,
"service": stats.Service,
} }
latencyLabels := prometheus.Labels{ latencyLabels := prometheus.Labels{