Closed mostlyjason closed 3 years ago
Pinging @elastic/agent (Team:Agent)
Beats logs its metrics every 30s. This was built before there was even a metrics endpoint in Beats. Elastic Agent behaves as expected here as it just "tails" the log file. Instead we should likely disable the logging of these metrics which I think can be done through a config option.
I remove the bug
label as I don't consider this a bug.
We'll add a config option to disable logging metrics. However the default behaviour will not change as we may need access to these metrics (through the log files) to help us debug issues.
@ruflin, my PR adds a setting that can be used in stand-alone mode to stop the beats from emitting metrics. If we want this to be enabled in fleet mode, the setting should be passed as part of the policy, and set through Kibana. I'm not sure what project (fleet/kibana) is responsible for doing that/where to make the issue.
If we want a short-term work around for fleet mode, we can enable the agent to pick it up as part of fleet.yml
, however this would still require a user to edit the file manually.
I don't think we should build any short term hacks around this and I'm also not sure on the urgency. @jen-huang As soon as there is a config option, we could like use this as the default in the policy?
Each agent policy needs to explicitly declare what agent monitoring options should be enabled, by default it is stored as ["logs", "metrics"]
on the policy. We can certainly add this new monitoring option to be enabled by default, but it will only kick in for new agent policies.
We could add a migration for 7.15 to add it to existing policies though. But I think we will want some conditional logic there, I suppose log_metrics
should be enabled when the policy also has metrics
monitoring enabled?
They are decoupled it's possible to enable log_metrics
and not metrics
.
However, we have an agent.logging.metrics.enabled
setting that we may reuse to pass to beats instead of adding the new one.
The default settings will not change from the current behaviour (metrics appear in logs).
We are reusing agent.logging.metrics.enabled
instead of introducing another setting.
The default (true
) has not changed. If it's set to false then the elastic-agent and all beats running under it will not have the metrics entries appear in the logs.
It looks like Elastic Agent is sending it's own monitoring metrics to the logs datastream. This is not useful as a log message. It should be sending this information to the metrics datastream instead.
Example event:
For confirmed bugs, please report: