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

Char replacer processor #4599

Closed

Conversation

doublerainbo
Copy link
Contributor

@doublerainbo doublerainbo commented Aug 27, 2018

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

This adds in a new processor plugin that runs a search and replace on all the metric names. Our current use case is that we're scraping off a bunch of data from prometheus and the convention there is to use a : as a the separator, but when we send it to an output we would want to use _ as the separator. The existing plugins match on exact naming match which is what prompted this change

@danielnelson
Copy link
Contributor

This seems handy, but it is also quite specialized. I wonder if we should combine it with #4476?

@doublerainbo
Copy link
Contributor Author

Open to putting it where it makes sense, please point me to the direction you'd like :)

@danielnelson
Copy link
Contributor

I tried to quickly see if I could fit this into the strings processor, but had a few issues modeling the config file. The difficulty is around field vs tag vs measurement as well as with key vs value. Additionally, the current and newly added processors all have a different feel and I would like to attempt to find a way where we can provide a bit more consistency.

Give me a few days and I'll come up with a proposal for comments.

@danielnelson
Copy link
Contributor

I do think we should merge this into strings, the final plugin could look something like this:

[[processors.strings]]
  [[processors.strings.replace]]
    measurement = "*"
    old = ":"
    new = "_"

The strings processor #4476 is very close to being finished, I think we can have it merged within a week at the most.

My full brain dump on processor configuration is in #4616

@doublerainbo
Copy link
Contributor Author

sounds like a plan, as I haven't worked on the string processor, should i be branching off of that PR and move my code into there or should i stay out of the way and wait until it is done, and see what course of action to take from there. thanks!

@danielnelson
Copy link
Contributor

If you are comfortable with it, you could branch the pr and after it is merged do an interactive rebase to remove the duplicate commits since we do a squash and merge.

If that sounds like a lot of fuss to you then I would probably just wait for it to be merged.

@danielnelson
Copy link
Contributor

@doublerainbo strings processor is merged into master now

@doublerainbo
Copy link
Contributor Author

closing in favour of #4686

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

Successfully merging this pull request may close these issues.

2 participants