Skip to content

Commit

Permalink
validate influx tags, the source of our woes
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Porter <portertech@gmail.com>
  • Loading branch information
portertech committed Dec 11, 2018
1 parent 9f34bef commit 903a1f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ func CreateInfluxMetrics(samples model.Vector, metricPrefix string) string {

for name, value := range sample.Metric {
if name != "__name__" {
metric += fmt.Sprintf(",%s=%s", name, value)
tags := fmt.Sprintf(",%s=%s", name, value)
if !strings.Contains(tags, "\n") && strings.Count(tags, "=") == 1 {
metric += tags
}
}
}

Expand All @@ -103,10 +106,7 @@ func CreateInfluxMetrics(samples model.Vector, metricPrefix string) string {

metric += fmt.Sprintf(" value=%s %d\n", value, timestamp)

segments := strings.Split(metric, " ")
if len(segments) == 3 {
metrics += metric
}
metrics += metric
}

return metrics
Expand Down

0 comments on commit 903a1f8

Please sign in to comment.