Skip to content
Snippets Groups Projects
Commit 929ba0a6 authored by Daniel Nelson's avatar Daniel Nelson Committed by GitHub
Browse files

Remove label value sanitization in prometheus output (#2939)

parent dcdcb70c
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,7 @@ func (p *PrometheusClient) Write(metrics []telegraf.Metric) error { ...@@ -205,7 +205,7 @@ func (p *PrometheusClient) Write(metrics []telegraf.Metric) error {
labels := make(map[string]string) labels := make(map[string]string)
for k, v := range tags { for k, v := range tags {
labels[sanitize(k)] = sanitize(v) labels[sanitize(k)] = v
} }
for fn, fv := range point.Fields() { for fn, fv := range point.Fields() {
......
...@@ -144,7 +144,7 @@ func TestWrite_Sanitize(t *testing.T) { ...@@ -144,7 +144,7 @@ func TestWrite_Sanitize(t *testing.T) {
require.True(t, ok) require.True(t, ok)
require.Equal(t, map[string]string{ 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) { func TestWrite_Gauge(t *testing.T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment