Add prefix to datadog metrics

This commit is contained in:
Huan Wang 2021-10-06 09:34:07 -06:00 committed by GitHub
parent 32340252b2
commit 85dd45cb81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 90 additions and 34 deletions

View file

@ -23,7 +23,7 @@ func TestStatsD(t *testing.T) {
statsdRegistry := RegisterStatsd(context.Background(), &types.Statsd{Address: ":18125", PushInterval: ptypes.Duration(time.Second), AddEntryPointsLabels: true, AddRoutersLabels: true, AddServicesLabels: true})
testRegistry(t, "", statsdRegistry)
testRegistry(t, defaultMetricsPrefix, statsdRegistry)
}
func TestStatsDWithPrefix(t *testing.T) {
@ -47,10 +47,6 @@ func testRegistry(t *testing.T, metricsPrefix string, registry Registry) {
t.Errorf("Statsd registry should return true for IsEnabled(), IsRouterEnabled() and IsSvcEnabled()")
}
if metricsPrefix == "" {
metricsPrefix = "traefik"
}
expected := []string{
metricsPrefix + ".config.reload.total:1.000000|c\n",
metricsPrefix + ".config.reload.total.failure:1.000000|c\n",