-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Elastic-Agent] Enable introspecting configuration #18124
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededExpand to view the summary
Build stats
|
I'm used to |
}, nil | ||
} | ||
|
||
// Execute tries to enroll the agent into Fleet. |
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.
You are sure the comment matches the behavior?
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.
oh my copy cat
I'm confused by your Option 3: You select an output and get the metricbeat config for it |
you select the output and you get configuration for all beats writing to that specific output |
@michalpristas I wonder if that would be the way someone thinks of trying to find what goes wrong during debugging. But lets iterate later on naming and order of params and get this in. |
i'm open to suggestions,i'm biased by how agent deal with streams |
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.
I think this would effectively help integrations team to move forward with debugging, let's fix the issue concerning the -c
we can do a follow for my suggestion of been able to export them.
Args: cobra.ExactArgs(0), | ||
Run: func(c *cobra.Command, args []string) { | ||
command, err := application.NewIntrospectConfigCmd("elastic-agent.yml") | ||
if err != nil { |
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.
There is a problem here, if you use -c
to specify another configuration we will still load the default and not the one specified.
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.
solved
cmd.Flags().StringP("program", "p", "", "type of program to introspect, needs to be combined with output. e.g filebeat") | ||
|
||
return cmd | ||
} |
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.
Two things, I've played with the command locally. When you run the "output" subcommand you have only the list of the outputs. Maybe we could have a better default like displaying all the configuration that we have for all the defined outputs?
Maybe we could add a flag that will output to disk all the configurations and grouped output, Maybe -disk
, its hard to find a good name because that behavior is often associated to -o (output).
/default/
filebeat.yml
metricbeat.yml
The above would allow anyone to test the configuration outside of the agent.
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.
can we do this in a follwup? let's get this in for 7.8 and we can work on naming and use cases in a separate issue. nicolas had also some comments about the form of the command
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.
LGTM get some debug in place.
* introspection * changelog * mage fmt * introspect -> inspect * follow -c argument * conflicts
* introspection * changelog * mage fmt * introspect -> inspect * follow -c argument * conflicts
What does this PR do?
This PR adds 3 options to our agents CLI
Option 1 - Introspecting current config
Usage
./elastic-agent inspect
This will print out current configuration either from fleet or from yml.
Sample output:
Option 2 - Introspecting used outputs
Usage
./elastic-agent inspect output
This will print out outputs which are actually used . If config contains definition for output but output is not used in any datastream it will not be present in the printout
Sample output:
Option 3: Introspecting specific output
Usage:
./elastic-agent inspect output -o default
This will print out actual configuration of the beats, this helps you understand how configuration retrieved from fleet translates to configuration which is sent out to the process itself.
Sample output:
Why is it important?
To improve debugging experience
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.