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

Change datatype for pipeline response #318

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/collectors/nodestats/pipeline_subcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ func (subcollector *PipelineSubcollector) Collect(pipeStats *responses.SinglePip
metricsHelper := prometheus_helper.SimpleMetricsHelper{Channel: ch, Labels: []string{pipelineID, endpoint}}

// ***** EVENTS *****
metricsHelper.NewIntMetric(subcollector.EventsOut, prometheus.CounterValue, pipeStats.Events.Out)
metricsHelper.NewIntMetric(subcollector.EventsFiltered, prometheus.CounterValue, pipeStats.Events.Filtered)
metricsHelper.NewIntMetric(subcollector.EventsIn, prometheus.CounterValue, pipeStats.Events.In)
metricsHelper.NewIntMetric(subcollector.EventsDuration, prometheus.GaugeValue, pipeStats.Events.DurationInMillis)
metricsHelper.NewIntMetric(subcollector.EventsQueuePushDuration, prometheus.GaugeValue, pipeStats.Events.QueuePushDurationInMillis)
metricsHelper.NewInt64Metric(subcollector.EventsOut, prometheus.CounterValue, pipeStats.Events.Out)
metricsHelper.NewInt64Metric(subcollector.EventsFiltered, prometheus.CounterValue, pipeStats.Events.Filtered)
metricsHelper.NewInt64Metric(subcollector.EventsIn, prometheus.CounterValue, pipeStats.Events.In)
metricsHelper.NewInt64Metric(subcollector.EventsDuration, prometheus.GaugeValue, pipeStats.Events.DurationInMillis)
metricsHelper.NewInt64Metric(subcollector.EventsQueuePushDuration, prometheus.GaugeValue, pipeStats.Events.QueuePushDurationInMillis)
// ******************

// ***** UP *****
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ responses.NodeStatsResponse{
Pipelines: {
".monitoring-logstash": {
Monitoring: responses.PipelineLogstashMonitoringResponse{},
Events: struct { Out int "json:\"out\""; Filtered int "json:\"filtered\""; In int "json:\"in\""; DurationInMillis int "json:\"duration_in_millis\""; QueuePushDurationInMillis int "json:\"queue_push_duration_in_millis\"" }{},
Events: responses.EventsResponse{},
Flow: responses.FlowResponse{},
Plugins: struct { Inputs []struct { ID string "json:\"id\""; Name string "json:\"name\""; Events struct { Out int "json:\"out\""; QueuePushDurationInMillis int "json:\"queue_push_duration_in_millis\"" } "json:\"events\"" } "json:\"inputs\""; Codecs []struct { ID string "json:\"id\""; Name string "json:\"name\""; Decode struct { Out int "json:\"out\""; WritesIn int "json:\"writes_in\""; DurationInMillis int "json:\"duration_in_millis\"" } "json:\"decode\""; Encode struct { WritesIn int "json:\"writes_in\""; DurationInMillis int "json:\"duration_in_millis\"" } "json:\"encode\"" } "json:\"codecs\""; Filters []struct { ID string "json:\"id\""; Name string "json:\"name\""; Events struct { Out int "json:\"out\""; In int "json:\"in\""; DurationInMillis int "json:\"duration_in_millis\"" } "json:\"events\"" } "json:\"filters\""; Outputs []struct { ID string "json:\"id\""; Name string "json:\"name\""; Events struct { Out int "json:\"out\""; In int "json:\"in\""; DurationInMillis int "json:\"duration_in_millis\"" } "json:\"events\""; Documents struct { Successes int "json:\"successes\""; NonRetryableFailures int "json:\"non_retryable_failures\"" } "json:\"documents\""; BulkRequests struct { WithErrors int "json:\"with_errors\""; Responses map[string]int "json:\"responses\"" } "json:\"bulk_requests\"" } "json:\"outputs\"" }{
Inputs: {
Expand All @@ -89,7 +89,7 @@ responses.NodeStatsResponse{
},
"main": {
Monitoring: responses.PipelineLogstashMonitoringResponse{},
Events: struct { Out int "json:\"out\""; Filtered int "json:\"filtered\""; In int "json:\"in\""; DurationInMillis int "json:\"duration_in_millis\""; QueuePushDurationInMillis int "json:\"queue_push_duration_in_millis\"" }{Out:0, Filtered:0, In:4001, DurationInMillis:0, QueuePushDurationInMillis:0},
Events: responses.EventsResponse{In:4001, Filtered:0, Out:0, DurationInMillis:0, QueuePushDurationInMillis:0},
Flow: responses.FlowResponse{
InputThroughput: struct { Current float64 "json:\"current\""; Lifetime float64 "json:\"lifetime\"" }{Current:6.7, Lifetime:124},
FilterThroughput: struct { Current float64 "json:\"current\""; Lifetime float64 "json:\"lifetime\"" }{Current:7.8, Lifetime:8.9},
Expand Down
12 changes: 3 additions & 9 deletions internal/fetcher/responses/nodestats_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,9 @@ type FlowResponse struct {

type SinglePipelineResponse struct {
Monitoring PipelineLogstashMonitoringResponse `json:".monitoring-logstash"`
Events struct {
Out int `json:"out"`
Filtered int `json:"filtered"`
In int `json:"in"`
DurationInMillis int `json:"duration_in_millis"`
QueuePushDurationInMillis int `json:"queue_push_duration_in_millis"`
} `json:"events"`
Flow FlowResponse `json:"flow"`
Plugins struct {
Events EventsResponse `json:"events"`
Flow FlowResponse `json:"flow"`
Plugins struct {
Inputs []struct {
ID string `json:"id"`
Name string `json:"name"`
Expand Down
Loading