Remove label value sanitization in prometheus output (#2939)

(cherry picked from commit 929ba0a637)
This commit is contained in:
Daniel Nelson 2017-06-21 12:36:29 -07:00 committed by Daniel Nelson
parent 9722d675bb
commit b0ba853395
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
2 changed files with 2 additions and 2 deletions

View File

@ -205,7 +205,7 @@ func (p *PrometheusClient) Write(metrics []telegraf.Metric) error {
labels := make(map[string]string)
for k, v := range tags {
labels[sanitize(k)] = sanitize(v)
labels[sanitize(k)] = v
}
for fn, fv := range point.Fields() {

View File

@ -144,7 +144,7 @@ func TestWrite_Sanitize(t *testing.T) {
require.True(t, ok)
require.Equal(t, map[string]string{
"tag_with_dash": "localhost_local"}, sample1.Labels)
"tag_with_dash": "localhost.local"}, sample1.Labels)
}
func TestWrite_Gauge(t *testing.T) {