adds metric middlware to route register

This commit is contained in:
bergquist
2017-09-14 14:26:32 +02:00
committed by Carl Bergquist
parent 6372e22180
commit 4bc6ecb241
5 changed files with 10 additions and 21 deletions
-13
View File
@@ -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 {