Skip to content
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

Merged
merged 2 commits into from
Oct 23, 2018
Merged

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Oct 21, 2018

This will report central management enabled status

closes #7979

This will report central management enabled status
@exekias exekias changed the title Add central management telmetry Add central management telemetry Oct 21, 2018
@ruflin
Copy link
Contributor

ruflin commented Oct 22, 2018

@exekias This will need backport?

@chrisronline I wonder if we should show this info somehow in monitoring?

3 similar comments
@ruflin
Copy link
Contributor

ruflin commented Oct 22, 2018

@exekias This will need backport?

@chrisronline I wonder if we should show this info somehow in monitoring?

@ruflin
Copy link
Contributor

ruflin commented Oct 22, 2018

@exekias This will need backport?

@chrisronline I wonder if we should show this info somehow in monitoring?

@ruflin
Copy link
Contributor

ruflin commented Oct 22, 2018

@exekias This will need backport?

@chrisronline I wonder if we should show this info somehow in monitoring?

@@ -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()))
Copy link
Contributor

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 :-(

@@ -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()))
Copy link
Contributor

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 :-(

@@ -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()))
Copy link
Contributor

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 :-(

@ruflin
Copy link
Contributor

ruflin commented Oct 22, 2018

Will this need a backport?

@chrisronline Perhaps we could should this somehow in the monitoring UI?

@exekias exekias added the needs_backport PR is waiting to be backported to other branches. label Oct 22, 2018
@chrisronline
Copy link
Contributor

@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.

@exekias
Copy link
Contributor Author

exekias commented Oct 22, 2018

Thank you for your changes @ruflin, as PR author I cannot approve them, but I'm ok with this going in 😄

@exekias exekias added the v6.5.0 label Oct 22, 2018

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()) }

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) }

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() }

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

Copy link
Contributor

@ruflin ruflin left a 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.

@exekias exekias merged commit 96e484c into elastic:master Oct 23, 2018
exekias added a commit to exekias/beats that referenced this pull request Oct 23, 2018
* Add central management telmetry

This will report central management enabled status

(cherry picked from commit 96e484c)
@exekias exekias removed the needs_backport PR is waiting to be backported to other branches. label Oct 23, 2018
exekias added a commit that referenced this pull request Oct 23, 2018
* Add central management telmetry

This will report central management enabled status

(cherry picked from commit 96e484c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic telemetry for Beats central configuration
4 participants