Commit ddbec02e authored by David Enyeart's avatar David Enyeart Committed by Gerrit Code Review
Browse files

Merge "Remove handler path from prometheus config"

parents 65d10641 63312439
......@@ -43,14 +43,9 @@ type Statsd struct {
Prefix string
}
type Prometheus struct {
HandlerPath string
}
type MetricsOptions struct {
Provider string
Statsd *Statsd
Prometheus *Prometheus
Provider string
Statsd *Statsd
}
type Options struct {
......@@ -176,7 +171,7 @@ func (s *System) initializeMetricsProvider() error {
case "prometheus":
s.Provider = &prometheus.Provider{}
s.mux.Handle(m.Prometheus.HandlerPath, s.handlerChain(prom.Handler(), s.options.TLS.Enabled))
s.mux.Handle("/metrics", s.handlerChain(prom.Handler(), s.options.TLS.Enabled))
return nil
default:
......
......@@ -230,9 +230,6 @@ var _ = Describe("System", func() {
BeforeEach(func() {
options.Metrics = operations.MetricsOptions{
Provider: "prometheus",
Prometheus: &operations.Prometheus{
HandlerPath: "/metrics",
},
}
system = operations.NewSystem(options)
Expect(system).NotTo(BeNil())
......
......@@ -206,6 +206,4 @@ operations:
address: {{ if .StatsdEndpoint }}{{ .StatsdEndpoint }}{{ else }}127.0.0.1:8125{{ end }}
writeInterval: 5s
prefix: {{ ReplaceAll (ToLower Peer.ID) "." "_" }}
prometheus:
handlerPath: /metrics
`
......@@ -270,9 +270,8 @@ type Operations struct {
}
type Metrics struct {
Provider string `yaml:"provider"`
Statsd *Statsd `yaml:"statsd,omitempty"`
Prometheus *Prometheus `yaml:"prometheus,omitempty"`
Provider string `yaml:"provider"`
Statsd *Statsd `yaml:"statsd,omitempty"`
}
type Statsd struct {
......@@ -281,7 +280,3 @@ type Statsd struct {
WriteInterval time.Duration `yaml:"writeInterval,omitempty"`
Prefix string `yaml:"prefix,omitempty"`
}
type Prometheus struct {
HandlerPath string `yaml:"handlerPath"`
}
......@@ -116,9 +116,8 @@ type OrdererOperations struct {
}
type OrdererMetrics struct {
Provider string `yaml:"Provider"`
Statsd *OrdererStatsd `yaml:"Statsd,omitempty"`
Prometheus *OrdererPrometheus `yaml:"Prometheus,omitempty"`
Provider string `yaml:"Provider"`
Statsd *OrdererStatsd `yaml:"Statsd,omitempty"`
}
type OrdererStatsd struct {
......@@ -127,7 +126,3 @@ type OrdererStatsd struct {
WriteInterval time.Duration `yaml:"WriteInterval,omitempty"`
Prefix string `yaml:"Prefix,omitempty"`
}
type OrdererPrometheus struct {
HandlerPath string `yaml:"handlerPath"`
}
......@@ -113,7 +113,5 @@ Operations:
Address: {{ if .StatsdEndpoint }}{{ .StatsdEndpoint }}{{ else }}127.0.0.1:8125{{ end }}
WriteInterval: 5s
Prefix: {{ ReplaceAll (ToLower Orderer.ID) "." "_" }}
Prometheus:
HandlerPath: /metrics
{{- end }}
`
......@@ -187,9 +187,8 @@ type Operations struct {
// Operations confiures the metrics provider for the orderer.
type Metrics struct {
Provider string
Statsd Statsd
Prometheus Prometheus
Provider string
Statsd Statsd
}
// Statsd provides the configuration required to emit statsd metrics from the orderer.
......@@ -200,11 +199,6 @@ type Statsd struct {
Prefix string
}
// Prometheus provides the configuration required to host prometheus.
type Prometheus struct {
HandlerPath string
}
// Defaults carries the default orderer configuration values.
var Defaults = TopLevel{
General: General{
......
......@@ -446,9 +446,6 @@ func newOperationsSystem(conf localconfig.Operations) *operations.System {
WriteInterval: conf.Metrics.Statsd.WriteInterval,
Prefix: conf.Metrics.Statsd.Prefix,
},
Prometheus: &operations.Prometheus{
HandlerPath: conf.Metrics.Prometheus.HandlerPath,
},
},
TLS: operations.TLS{
Enabled: conf.TLS.Enabled,
......
......@@ -879,9 +879,6 @@ func newOperationsSystem() *operations.System {
WriteInterval: viper.GetDuration("operations.metrics.statsd.writeInterval"),
Prefix: viper.GetString("operations.metrics.statsd.prefix"),
},
Prometheus: &operations.Prometheus{
HandlerPath: viper.GetString("operations.metrics.prometheus.handlerPath"),
},
},
TLS: operations.TLS{
Enabled: viper.GetBool("operations.tls.enabled"),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment