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.
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
thbkrkr
left a comment
There was a problem hiding this comment.
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