Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Instrumental] Underscore metric name output #1607

Merged
merged 24 commits into from Aug 30, 2016
Merged

[Instrumental] Underscore metric name output #1607

merged 24 commits into from Aug 30, 2016

Conversation

janxious
Copy link
Contributor

@janxious janxious commented Aug 8, 2016

Some of the metrics emitted by various input plugins include illegal metric names for Instrumental, and this does a more thorough job of massaging those metrics into something usable.

Required for all PRs:

  • CHANGELOG.md updated
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

janxious and others added 19 commits June 23, 2016 16:46
…end of write cycle so we don't hold open idle connections, which has the benefit of mostly removing the chance of getting hopelessly connection lost
correct URL from instrumental fork to origin and put the change in the correct part of the file
@sparrc
Copy link
Contributor

sparrc commented Aug 9, 2016

you need to run go fmt ./...

@janxious
Copy link
Contributor Author

janxious commented Aug 9, 2016

@sparrc It is done!

// replace invalid components of metric name with underscore
clean_metric := MetricNameReplacer.ReplaceAllString(metric, "_")

if !ValueIncludesBadChar.MatchString(value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need to be checking this? how would it ever be true if we already replaced the bad characters above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above cleans up the metric name, this line rejects bad values. If someone sends a name with bad characters, we just turn them to underscores, but if someone sends a bad value, we simply drop it.

I think the bad value that triggered this change was a time (as in HH:MM).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sparrc bumps

@sparrc sparrc merged commit b863ee1 into influxdata:master Aug 30, 2016
sparrc added a commit that referenced this pull request Aug 30, 2016
@janxious
Copy link
Contributor Author

Thanks @sparrc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants