Changed Metrics to be exposed via Exporter

This change exposes the gateway metrics with an exporter which
implements the Collector interface of prometheus.
This change Fixes #697

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
This commit is contained in:
Ken Fukuyama
2018-08-07 07:33:25 +09:00
committed by Alex Ellis
parent 6d6a487711
commit 4fabd50799
4 changed files with 134 additions and 15 deletions

View File

@ -54,8 +54,6 @@ func BuildMetricsOptions() MetricOptions {
}
//RegisterMetrics registers with Prometheus for tracking
func RegisterMetrics(metricsOptions MetricOptions) {
prometheus.Register(metricsOptions.GatewayFunctionInvocation)
prometheus.Register(metricsOptions.GatewayFunctionsHistogram)
prometheus.Register(metricsOptions.ServiceReplicasCounter)
func RegisterExporter(exporter *Exporter) {
prometheus.MustRegister(exporter)
}