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
OpenTsdbWriter - Custom Tag Support #7357
Conversation
I have decided I am going to try and re-work this slightly to remove the unnecessary Clone, as per commentary in #7353 |
2406d7d
to
43978f6
Compare
Cloning behaviour has been removed, this should now be a bit more efficient. I'm not too sure if there could be an opportunity for a memory leak in calling the new This will only be called during a resume (startup, reload signal or HA cluster change), but I wanted to make sure that the underlying Apart from that, I think this is ready for review or further comments. |
Thanks. You're not forgotten, I am just too busy. Will review asap. |
Added OpenTSDB custom tagging configuration template
Added configuration caching on instantiation.
Added OpenTSDB Generic Metric functionality
43978f6
to
166e79f
Compare
I've also added some extra functionality off the back of this PR which provides some more flexibility around choosing OpenTSDB metric names and exposing this in the config file. This code added in the latest commit today has been running in production for the last two months on version 2.10.5, in an environment that has 500 hosts and growing, 15 satellites and growing and two masters in HA. The OpenTSDBWriter has been ticking away well during this time. Further testing has been performed to ensure an older style configuration file behaves in the exact same way as it did before this PR. This is the last of any feature additions I will add in this PR. It is now ready for review. Summary of additions: Metric Prefixes Generic Metrics Example:
This can still be helpful in some situations, and the default functionality has not been modified at all to ensure current users are not impacted when they upgrade. Generic metrics removes the perfdata label from the metric name and instead adds it as a
|
Awesome, thanks for your hard work on this 👍 Also, the documentation is top notch :) |
Currently the OpenTsdbWriter does not allow any configuration of the tags that are sent with perfdata, it is currently hard-coded to send the hostname, object type and service name as tags.
This PR adds support to define tags to send to OpenTSDB within the config file. These tags are sent in addition to the default ones.
This functionality is almost identical to how InfluxDbWriter allows setting custom tags, which can be user defined custom attributes (vars dictionary). Most of the implementation has been adapted from InfluxDbWriter.
For existing users who are using the OpenTsdbWriter, no functionality is changed unless the config file contains the new (optional) blocks. I didn't want to change too much of the core functionality as it might break upgrades for some users.
This is my first PR; I am happy to work with you on whatever needs to be done.