-
Notifications
You must be signed in to change notification settings - Fork 712
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 Logstash Telemetry #6562
Add Logstash Telemetry #6562
Conversation
8a2bd10
to
b2bf2d9
Compare
PR ready for review |
} | ||
|
||
for _, ls := range logstashList.Items { | ||
ls := ls |
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.
remove it?
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 one was caught by the linter, and is related to loop variable semantics in go - there is a great summary of the issue (and proposal for "fixing" it in future versions of golang) here. I don't actually think that that behaviour will bite us here, given what we are doing, but I'm still happy keeping this "odd" looking assignment in here and keep the linter satisfied
Includes TODO items to be added after Pipeline PR lands
Add in separate PR once PipelineRef code lands
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, left a few nits.
It's not from your PR, but I realize that we started having duplicates and making the stats slightly different from app to app, causing us to miss some stats (stack mon for Kibana, or helm for agent and beats).
I think we could improve that by creating some reusable structs like this.
type baseStats struct {
ResourceCount int32 `json:"resource_count"`
PodCount int32 `json:"pod_count"`
}
type helmStats struct {
HelmManagedResourceCount int32 `json:"helm_resource_count"`
}
type stackMonStats struct {
StackMonitoringLogsCount int32 `json:"stack_monitoring_logs_count"`
StackMonitoringMetricsCount int32 `json:"stack_monitoring_metrics_count"`
}
func logstashStats(k8sClient k8s.Client, managedNamespaces []string) (string, interface{}, error) {
logstashStats := struct {
baseStats
helmStats
stackMonStats
ServiceCount int32 `json:"service_count"`
PipelineCount int32 `json:"pipeline_count"`
PipelineRefCount int32 `json:"pipeline_ref_count"`
}{}
...
I made a sketch here.
It's not completely trivial so it can be done in another PR, unless you're motivated to do it in this one :).
@thbkrkr Ready for another round |
This PR adds telemetry related to Logstash