-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Collect version metadata for Fluentd #5057
Conversation
Codecov Report
|
eb66d12
to
92f7106
Compare
92f7106
to
2d14166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall 👍 , few comments.
command = self._fluentd_command + ['--version'] | ||
|
||
try: | ||
out, _, _ = get_subprocess_output(command, self.log, False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the the api doesn't provide currently the version, but can be added easily upstream here, example:
def config_json(req)
obj = {
'pid' => Process.pid,
'ppid' => Process.ppid
'version' => Fluent::VERSION
}.merge(@agent.fluentd_opts)
opts = build_option(req)
render_json(obj, pretty_json: opts[:pretty_json])
end
Even if we push this change upstream, it will be available only for new versions, so we will still need to retrieve versions via command line for old versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. I'll open an issue (or most likely a PR directly) on the fluentd repo to discuss adding the version to their monitoring REST API.
Agreed that this is not a blocker w.r.t. this PR, though? (i.e. we can add the API-based version lookup later.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexandreYang I opened fluent/fluentd#2705 and fluent/fluentd#2706 on the Fluentd repo.
Will discuss there whether supporting accessing a remote Fluentd instance makes any sense at all from a monitoring perspective.
I'm now less sure that it can actually be a possible setup: most examples from the Fluentd monitoring docs show calls to localhost
or similar.
So, if people always only install the integration on the host where Fluentd is installed, then the benefits we'd get from using the API are less clear IMO.
Co-Authored-By: Alexandre Yang <[email protected]>
Co-Authored-By: Alexandre Yang <[email protected]>
hello, is there a reason why we add this parameter in the init_config and in the instance section ? :) |
Hi @l0k0ms, thanks for looking at this. The On our side, we use it to test various cases — e.g. what happens if the Fluentd command does not exist, or if the command returns unexpected output? This technique is currently in use in some other integrations, e.g. Gunicorn (see #4968 for discussion) and |
@florimondmanca ohhhh i missed that.. many thanks for the clarification :) Doc wise this PR is g2g |
3083b6a
👋Given that "remote version" PR has been merged into fluentd upstream, is there any way to make datadog agent use it instead of shelling out to It seems like there's no way to disable this version check and at 15k+ hosts we seem to be having a lot of logging noise about those failures:
Running datadog-agent on kubernetes so naturally no fluentd binary available within datadog container. |
Hi @bai, thanks for the heads up! You're correct, upstream PR fluent/fluentd#2706 got merged and got released as part of Fluentd v1.8.0 in December (see changelog). This means we can look at using the new REST endpoint in priority, and fallback to a shell command for older Fluentd installs. We'd also need to update the integration to honor any We'll try to take a look at these items soon, and report back! Thanks. |
Disabling collection done in #6061 |
REST call added in #6062 |
@bai Fluentd check with latest changes is being released. Version is 1.6.0. You can install it with the integration command |
Many thanks, this is really helpful 🙏 |
What does this PR do?
Motivation
Additional Notes
fluentd
command override trick).tox.ini
and the Compose setup as Fluentd doesn't always use thevX.Y.Z
scheme for their Docker image tags.fluentd
command is available in the Agent. See Collect version metadata for Fluentd #5057 (comment)Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached