-
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
Added cloud.id and cloud.auth config settings #4964
Conversation
This adds two new configuration settings: `cloud.id` and `cloud.auth`. They can be used in the configuration file, or from the CLI like this: ``` ./metricbeat -e -E cloud.id=<cloud-id> -E cloud.auth=<cloud-auth> ``` The ES/KB settings are changed via overwritting, but we display an INFO level message that the settings are changed by the cloud-id. Closes elastic#4959.
@dedemorton I added short docs descriptions for the new settings in the Output section, together with an example, but it might make sense (for another PR) to have a dedicated "Getting started with Elastic Cloud" guide. |
filebeat/filebeat.reference.yml
Outdated
@@ -595,6 +595,19 @@ filebeat.prospectors: | |||
#processors: | |||
#- add_docker_metadata: ~ | |||
|
|||
#============================= Elastic Cloud ================================== | |||
|
|||
# These settings simplify using Beatname with the Elastic Cloud (https://cloud.elastic.co/). |
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 says Beatname in all files
libbeat/cloudid/cloudid_test.go
Outdated
errMsg string | ||
}{ | ||
{ | ||
name: "cloud.auth specified by cloud.id not", |
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 there is a typo here: s/by/but/
libbeat/cloudid/cloudid.go
Outdated
return err | ||
} | ||
|
||
err = cfg.SetChild("output.elasticsearch.hosts", -1, esURLConfig) |
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.
before setting anything in output.elasticsearch.X
, check the config is actually enabled/available via:
esConfig, _ := cfg.GetChild("output.elasticsearch")
esEnabled = esConfig.Enabled()
kibConfig, _ := cfg.GetChild("setup.kibana")
kibEnabled = kibConfig.Enabled()
By setting values on a non-present section, you will automatically enable the section (enabled
always defaults to true).
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.
As discussed, I added a check that by auto-enabling the ES output we don't enable two outputs.
libbeat/cloudid/cloudid.go
Outdated
return errors.Errorf("The cloud.id setting enables the Elasticsearch output, but you already have the %s output enabled in the config", namespace.Name()) | ||
} | ||
} | ||
|
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.
this can be simplified to:
tmp := struct {
Output common.ConfigNamespace `config:"output"`
}{}
if err := cfg.Unpack(&tmp); err != nil {
return err
}
if out := tmp.Output; if out.IsSet() && out.Name() != "elasticsearch" {
return errors.Errorf("...")
}
You can also capture the Kibana settings, in case we want to do some validations.
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.
Thanks, I took your version.
Changes: * Add support for cloud id. See elastic/beats#4964 for more details. This could simplify the onboard for users that use apm-server with the Cloud in the future. * Be able to overwrite index pattern in the index template. See elastic/beats#4769 for more details. This allows to clean up our system tests.
Important changes / additions: * Add support for cloud id. See elastic/beats#4964 for more details. This could simplify the onboard for users that use apm-server with the Cloud in the future. * Be able to overwrite index pattern in the index template. See elastic/beats#4769 for more details. This allows to clean up our system tests.
Important changes / additions: * Add support for cloud id. See elastic/beats#4964 for more details. This could simplify the onboard for users that use apm-server with the Cloud in the future. * Be able to overwrite index pattern in the index template. See elastic/beats#4769 for more details. This allows to clean up our system tests.
* Added cloud.id and cloud.auth config settings This adds two new configuration settings: `cloud.id` and `cloud.auth`. They can be used in the configuration file, or from the CLI like this: ``` ./metricbeat -e -E cloud.id=<cloud-id> -E cloud.auth=<cloud-auth> ``` The ES/KB settings are changed via overwritting, but we display an INFO level message that the settings are changed by the cloud-id. Closes elastic#4959. * goimports fix * aded more tests * added basic docs * changelog * addressed comments * Check that we're not enabling a second output * remove unused var * Addressed comments (cherry picked from commit bd6981d)
Important changes / additions: * Add support for cloud id. See elastic/beats#4964 for more details. This could simplify the onboard for users that use apm-server with the Cloud in the future. * Be able to overwrite index pattern in the index template. See elastic/beats#4769 for more details. This allows to clean up our system tests.
This adds two new configuration settings: `cloud.id` and `cloud.auth`. They can be used in the configuration file, or from the CLI like this: ``` ./metricbeat -e -E cloud.id=<cloud-id> -E cloud.auth=<cloud-auth> ``` The ES/KB settings are changed via overwritting, but we display an INFO level message that the settings are changed by the cloud-id. Closes #4959. * goimports fix * aded more tests * added basic docs * changelog * addressed comments * Check that we're not enabling a second output * remove unused var * Addressed comments (cherry picked from commit bd6981d)
…#4976) This adds two new configuration settings: `cloud.id` and `cloud.auth`. They can be used in the configuration file, or from the CLI like this: ``` ./metricbeat -e -E cloud.id=<cloud-id> -E cloud.auth=<cloud-auth> ``` The ES/KB settings are changed via overwritting, but we display an INFO level message that the settings are changed by the cloud-id. Closes elastic#4959. * goimports fix * aded more tests * added basic docs * changelog * addressed comments * Check that we're not enabling a second output * remove unused var * Addressed comments (cherry picked from commit 3d32342)
This adds two new configuration settings:
cloud.id
andcloud.auth
.They can be used in the configuration file, or from the CLI like this:
The ES/KB settings are changed via overwritting, but we display an INFO
level message that the settings are changed by the cloud-id.
Closes #4959.
Left TODOs: