adds metric middlware to route register
This commit is contained in:
committed by
Carl Bergquist
parent
6372e22180
commit
4bc6ecb241
@@ -54,7 +54,6 @@ const (
|
||||
)
|
||||
|
||||
var metricCategoryPrefix []string = []string{"proxy_", "api_", "page_", "alerting_", "aws_", "db_", "stat_", "go_", "process_"}
|
||||
var ignorePrefix []string = []string{"http_"}
|
||||
|
||||
// Config defines the Graphite bridge config.
|
||||
type Config struct {
|
||||
@@ -206,18 +205,6 @@ func (b *Bridge) writeMetrics(w io.Writer, mfs []*dto.MetricFamily, prefix strin
|
||||
return err
|
||||
}
|
||||
|
||||
ignoreThisMetric := false
|
||||
for _, v := range ignorePrefix {
|
||||
if strings.HasPrefix(mf.GetName(), v) {
|
||||
ignoreThisMetric = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ignoreThisMetric {
|
||||
continue
|
||||
}
|
||||
|
||||
buf := bufio.NewWriter(w)
|
||||
for _, s := range vec {
|
||||
if err := writePrefix(buf, prefix); err != nil {
|
||||
|
||||
@@ -91,7 +91,7 @@ func init() {
|
||||
Name: "http_request_total",
|
||||
Help: "http request counter",
|
||||
},
|
||||
[]string{"code", "method"},
|
||||
[]string{"handler", "statuscode", "method"},
|
||||
)
|
||||
|
||||
M_Http_Request_Summary = prometheus.NewSummaryVec(
|
||||
@@ -99,7 +99,7 @@ func init() {
|
||||
Name: "http_request_duration",
|
||||
Help: "http request summary",
|
||||
},
|
||||
[]string{"code", "method"},
|
||||
[]string{"handler", "statuscode", "method"},
|
||||
)
|
||||
|
||||
M_Api_User_SignUpStarted = prometheus.NewCounter(prometheus.CounterOpts{
|
||||
|
||||
Reference in New Issue
Block a user