-
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
Add central management telemetry #8671
Conversation
This will report central management enabled status
@exekias This will need backport? @chrisronline I wonder if we should show this info somehow in monitoring? |
3 similar comments
@exekias This will need backport? @chrisronline I wonder if we should show this info somehow in monitoring? |
@exekias This will need backport? @chrisronline I wonder if we should show this info somehow in monitoring? |
@exekias This will need backport? @chrisronline I wonder if we should show this info somehow in monitoring? |
libbeat/cmd/instance/beat.go
Outdated
@@ -309,6 +310,10 @@ func (b *Beat) createBeater(bt beat.Creator) (beat.Beater, error) { | |||
return nil, err | |||
} | |||
|
|||
// Report central management state | |||
mgmt := monitoring.GetNamespace("state").GetRegistry().NewRegistry("management") | |||
monitoring.NewString(mgmt, "enabled").Set(strconv.FormatBool(b.ConfigManager.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.
This should be a bool and not a string. Problem is I don't think we support Bool yet :-(
libbeat/cmd/instance/beat.go
Outdated
@@ -309,6 +310,10 @@ func (b *Beat) createBeater(bt beat.Creator) (beat.Beater, error) { | |||
return nil, err | |||
} | |||
|
|||
// Report central management state | |||
mgmt := monitoring.GetNamespace("state").GetRegistry().NewRegistry("management") | |||
monitoring.NewString(mgmt, "enabled").Set(strconv.FormatBool(b.ConfigManager.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.
This should be a bool and not a string. Problem is I don't think we support Bool yet :-(
libbeat/cmd/instance/beat.go
Outdated
@@ -309,6 +310,10 @@ func (b *Beat) createBeater(bt beat.Creator) (beat.Beater, error) { | |||
return nil, err | |||
} | |||
|
|||
// Report central management state | |||
mgmt := monitoring.GetNamespace("state").GetRegistry().NewRegistry("management") | |||
monitoring.NewString(mgmt, "enabled").Set(strconv.FormatBool(b.ConfigManager.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.
This should be a bool and not a string. Problem is I don't think we support Bool yet :-(
Will this need a backport? @chrisronline Perhaps we could should this somehow in the monitoring UI? |
@ruflin Ideally, this data is reported through monitoring documents (instead of an api) so we can support multi-cluster setups, so as long as it's reported there, we should be able to show it. |
Thank you for your changes @ruflin, as PR author I cannot approve them, but I'm ok with this going in 😄 |
|
||
func (v *Bool) Get() bool { return v.f.Load() } | ||
func (v *Bool) Set(value bool) { v.f.Store(value) } | ||
func (v *Bool) Visit(_ Mode, vs Visitor) { vs.OnBool(v.Get()) } |
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 method Bool.Visit should have comment or be unexported
} | ||
|
||
func (v *Bool) Get() bool { return v.f.Load() } | ||
func (v *Bool) Set(value bool) { v.f.Store(value) } |
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 method Bool.Set should have comment or be unexported
return v | ||
} | ||
|
||
func (v *Bool) Get() bool { return v.f.Load() } |
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 method Bool.Get should have comment or be unexported
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.
Ignoring hound as these are one liners.
@chrisronline The data will be reported as soon as this PR is merged.
* Add central management telmetry This will report central management enabled status (cherry picked from commit 96e484c)
This will report central management enabled status
closes #7979