-
Notifications
You must be signed in to change notification settings - Fork 143
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
Support setting the agent log level to Trace in Fleet #2212
Comments
In addition to this can we support overriding the default log level per policy? I can only change the log level per agent, but the agents come and go in an autoscaling Kubernetes cluster. Additionally, we can support setting the log level from the environment in the configuration like the elasticsearch configuration: https://github.com/elastic/elastic-agent/blob/main/elastic-agent.docker.yml#L7-L9. This would allow me to just run the container |
Would also like to see the ability to override the default log level per policy or globally. |
Changing the log level per policy needs to be supported in Fleet, it should be possible to do this today for a standalone agent. I've opened elastic/kibana#158861 to track this. For the trace log level in this issue was used to hide some messages that were generated for every event and flooding the log files, making them useless for debugging. There isn’t any value in turning this on right now. We can eventually add the ability to change the log level per input or integration, we are unlikely to expose the trace level until we do that as its the only way to control the volume of logs enough to keep it useful. |
Depends on elastic/kibana#158861 |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
@cmacknz now that elastic/kibana#158861 landed are we good with closing this one or do we really want to add the trace option in Fleet UI? |
The need for this is going away now that we can write noisy per event logs to a separate file, closing. |
@cmacknz, is this documented somewhere? See this comment in elastic/sdh-beats#5005. |
@belimawr where is the event log file for agent documented? |
It's documented alongside the other already existing logs documentation:
|
So is |
@defensivedepth what logs are you looking for? Is is the raw events Filebeat publishes or something else? Do you need to be able to see them in Kibana or collecting an Agent diagnostics is an option? |
@belimawr Yes, raw events Filebeat publishes. Collecting an Agent diagnostics is an option - does that exist already? |
Yes, it is! You can run Another option is via Fleet UI: Fleet -> Agents -> -> Diagnostics -> Request diagnostics.zip |
Thanks @belimawr ! |
@belimawr I tried this out and it seems I get the same level of logs seen from the fleet UI? I am still unable to view the raw event logs. |
The events log do not go to the UI. They can be extremely verbose and can also contain sensitive data that should not be shipped alongside the monitoring logs/data. They can still be collected through the UI if you request the diagnostics, then if you want to visualise/analyse the logs in Kibana, you can upload them in Kibana. |
Thanks for the assistance, I am running I have the elastic-agent shipping to logstash, so the correct work around I use is to configure an additional logstash pipeline to write events to a file. |
The raw events go to a different folder, so |
Is there an associated configuration option for logging to events directory? Here is what is under ./logs in the unzipped diagnostics
|
@reyesj2 which version of the Elastic-Agent are you running? The event log file was released in |
That's it, I am running version 8.14.3. Thanks for your time on this |
The Fleet UI does not know about the trace level that was introduced in #1955
We will need to ensure the agent settings action handler understands the new Trace log level:
elastic-agent/internal/pkg/agent/application/actions/handlers/handler_action_settings.go
Lines 52 to 60 in fefe64f
In the Fleet UI the following two definitions need to be changed to allow setting the Trace level.
https://github.com/elastic/kibana/blob/f78236a2e4c1532a9a135444bea95a0f89d1047e/x-pack/plugins/fleet/server/types/models/agent.ts#L32-L42
https://github.com/elastic/kibana/blob/f78236a2e4c1532a9a135444bea95a0f89d1047e/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx#L48-L53
The text was updated successfully, but these errors were encountered: