2020-09-02 15:24:17 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package usagemetrics
|
|
|
|
|
2020-10-09 16:01:45 +00:00
|
|
|
import (
|
|
|
|
"github.com/armon/go-metrics"
|
|
|
|
"github.com/hashicorp/consul/agent/consul/state"
|
|
|
|
)
|
2020-09-02 15:24:17 +00:00
|
|
|
|
2020-10-09 16:01:45 +00:00
|
|
|
func (u *UsageMetricsReporter) emitServiceUsage(serviceUsage state.ServiceUsage) {
|
|
|
|
metrics.SetGaugeWithLabels(
|
|
|
|
[]string{"consul", "state", "services"},
|
|
|
|
float32(serviceUsage.Services),
|
|
|
|
u.metricLabels,
|
|
|
|
)
|
|
|
|
|
|
|
|
metrics.SetGaugeWithLabels(
|
|
|
|
[]string{"consul", "state", "service_instances"},
|
|
|
|
float32(serviceUsage.ServiceInstances),
|
|
|
|
u.metricLabels,
|
|
|
|
)
|
|
|
|
}
|