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

Enable agent to send Version string #6104

Closed
wants to merge 3 commits into from

Conversation

nicgrobler
Copy link
Contributor

@nicgrobler nicgrobler commented Jul 10, 2019

This PR (addresses #5958) introduces a monitor for the agent itself - this is a small, specific “mini agent” that sits alongside the main agent (rather than within the lower-levels, where the plugins live). Due to this, it is able to listen for signals (from telegraph), and also see and report on any meta-data concerning the agent itself - for example, the version string, number of inputs etc (which no plugin can see because it has no visibility back up into the agent). This agent monitor is autonomous once started, and does not interact with the main agent.

It brings the following functionality:

  • able to parse version string at runtime from agent itself.

  • split string into numeric fields allowing sorting / filtering etc.

  • validates that it is semantic in format.

  • via config, allows for ignoring version format, which will send the string to DB, but not numerics (as these are no longer useful if format is invalid). Can be useful in testing.

  • listen and report on signals received by telegraf.

  • all configurable via telegraf agent configuration (frequency, what it collects etc).

The version allows for queries like this (Chronograf as example):
Screenshot 2019-07-09 at 07 43 02

And the state changes look like this:
Screenshot 2019-07-09 at 14 47 37

Required for all PRs:

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

@nicgrobler nicgrobler changed the title initial commit for agent monitor addresses influxdata#5958 Enable agent to send Version string - addresses influxdata#5958 Jul 10, 2019
@nicgrobler nicgrobler changed the title Enable agent to send Version string - addresses influxdata#5958 Enable agent to send Version string Jul 10, 2019
@danielnelson
Copy link
Contributor

Nice, thanks for sharing. This gives me some ideas, but I do think we will probably want to implement this as part of the internal plugin using the selfstats system. Still I'd like keep this open for anyone who wants something now and also as a reference.

@nicgrobler
Copy link
Contributor Author

@danielnelson yep, I initially went that way, but needed state changes (signals), and the code smell got pretty bad. This represented the ‘least bad’ solution I came up with without rewriting large parts of the ‘internal’ code to do it...I am happy if you get anything from my efforts, and look forward to learning how you guys solve it

@sjwang90 sjwang90 added area/agent feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Nov 24, 2020
@srebhan
Copy link
Member

srebhan commented Apr 8, 2021

Can you please explain why you don't send the metric in the existing agent at the end of the startup? It should have all information I think...

@srebhan srebhan self-assigned this Dec 6, 2021
@srebhan
Copy link
Member

srebhan commented Dec 6, 2021

@nicgrobler are you still interested in this PR?

@powersj
Copy link
Contributor

powersj commented Jan 24, 2022

Hi,

This PR has not been touched in a while and as a result I am going to close it. We are happy to review again once someone picks this back up with the suggested changes and rebased on master.

Thanks!

@powersj powersj closed this Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin needs design review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants