-
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
Configuration to allow users to retry loading dashboards #6560
Conversation
@@ -21,13 +23,13 @@ type KibanaLoader struct { | |||
msgOutputter MessageOutputter | |||
} | |||
|
|||
func NewKibanaLoader(cfg *common.Config, dashboardsConfig *Config, hostname string, msgOutputter MessageOutputter) (*KibanaLoader, error) { | |||
func NewKibanaLoader(ctx context.Context, cfg *common.Config, dashboardsConfig *Config, hostname string, msgOutputter MessageOutputter) (*KibanaLoader, error) { |
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.
exported function NewKibanaLoader should have comment or be unexported
libbeat/dashboards/config.go
Outdated
Retry *Retry `config:retry` | ||
} | ||
|
||
type Retry struct { |
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.
exported type Retry should have comment or be unexported
2371159
to
4ac7c1a
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.
That's a nice addition and pretty useful when Kibana is slow to start up. I can already see how I will use that in Demo's. Could you add a changelog?
We recently added also some dashboard tests in some beats, but not sure if we can test it there properly.
libbeat/dashboards/config.go
Outdated
} | ||
|
||
var defaultConfig = Config{ | ||
KibanaIndex: ".kibana", | ||
AlwaysKibana: false, | ||
Retry: &Retry{ | ||
Enabled: 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.
Can you add the defaults for interval and maximum here too?
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.
sure thing, what do you think is reasonable?
1 sec/ unlimited?
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.
SGTM, especially as the feature is off by default.
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.
done 3bd3affaa9242bd7072207a911f1313ead19c30e
4ae6de7
to
fdc0308
Compare
added changelog fdc0308f204f20d088b571460a509bae5b2427a5 |
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.
Could you add the config options to the config reference file here (https://github.com/elastic/beats/blob/master/libbeat/_meta/config.reference.yml#L639) and run make update
in the beats directory?
After that we should be good to go.
@@ -99,3 +99,19 @@ NOTE: This setting only works for Kibana 6.0 and newer. | |||
|
|||
Force loading of dashboards using the Kibana API without querying Elasticsearch for the version | |||
The default is `false`. | |||
|
|||
[float] | |||
==== `setup.dashboards.retry.enabled` |
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 for the docs.
… not reachable, instead of exiting right away.
fdc0308
to
68d3c51
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.
The filebeat error is unrelated.
filebeat/filebeat.reference.yml
Outdated
@@ -1223,6 +1223,17 @@ output.elasticsearch: | |||
# how to install the dashboards by first querying Elasticsearch. | |||
#setup.dashboards.always_kibana: false | |||
|
|||
# If true and Kibana is not reachable at the time when dashboards are loaded, | |||
# it will retry to reconnect to Kibana instead of exiting with an error. | |||
#setup.dashboards.retry.enabled |
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.
If there are default values we normally put them into the reference doc, so here it would be #setup.dashboards.retry.enabled: false
. Similar for the values below.
[float] | ||
==== `setup.dashboards.retry.enabled` | ||
|
||
If this option is set to true, and Kibana is not reachable at the time when dashboards are loaded, |
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.
My comment above made me realise that having a comment about the defaults here would also be great. Some at then of the sentence like. Default is 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.
Thx. Waiting for green.
Thanks for the addition. |
Configuration to allow users to retry loading dashboards if Kibana is not reachable, instead of exiting right away.
... if Kibana not reachable, instead of exiting right away.