From 7b46ab17f6debaffb94e1ae9a42b1082bb9f9323 Mon Sep 17 00:00:00 2001 From: Arthur Kepler <610274+excalq@users.noreply.github.com> Date: Thu, 20 Apr 2023 14:33:15 -0400 Subject: [PATCH] 93: Adds logstash_stats_pipeline_up metrics --- collectors/nodestats/nodestats_collector_test.go | 1 + collectors/nodestats/pipeline_subcollector.go | 2 ++ scripts/snapshots/metric_names.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/collectors/nodestats/nodestats_collector_test.go b/collectors/nodestats/nodestats_collector_test.go index 3c93bdc8..0118430d 100644 --- a/collectors/nodestats/nodestats_collector_test.go +++ b/collectors/nodestats/nodestats_collector_test.go @@ -67,6 +67,7 @@ func TestCollectNotNil(t *testing.T) { "logstash_stats_jvm_threads_count", "logstash_stats_jvm_threads_peak_count", "logstash_stats_jvm_uptime_millis", + "logstash_stats_pipeline_up", "logstash_stats_pipeline_events_duration", "logstash_stats_pipeline_events_filtered", "logstash_stats_pipeline_events_in", diff --git a/collectors/nodestats/pipeline_subcollector.go b/collectors/nodestats/pipeline_subcollector.go index 88d951d5..255b854a 100644 --- a/collectors/nodestats/pipeline_subcollector.go +++ b/collectors/nodestats/pipeline_subcollector.go @@ -76,6 +76,8 @@ func (collector *PipelineSubcollector) Collect(pipeStats *responses.SinglePipeli ch <- prometheus.MustNewConstMetric(collector.EventsDuration, prometheus.CounterValue, float64(pipeStats.Events.DurationInMillis), pipelineID) ch <- prometheus.MustNewConstMetric(collector.EventsQueuePushDuration, prometheus.CounterValue, float64(pipeStats.Events.QueuePushDurationInMillis), pipelineID) + ch <- prometheus.MustNewConstMetric(collector.Up, prometheus.GaugeValue, float64(collector.isPipelineHealthy(pipeStats.Reloads)), pipelineID) + ch <- prometheus.MustNewConstMetric(collector.ReloadsSuccesses, prometheus.CounterValue, float64(pipeStats.Reloads.Successes), pipelineID) ch <- prometheus.MustNewConstMetric(collector.ReloadsFailures, prometheus.CounterValue, float64(pipeStats.Reloads.Failures), pipelineID) diff --git a/scripts/snapshots/metric_names.txt b/scripts/snapshots/metric_names.txt index 16e47f20..29cc1b60 100644 --- a/scripts/snapshots/metric_names.txt +++ b/scripts/snapshots/metric_names.txt @@ -14,6 +14,7 @@ logstash_stats_jvm_mem_non_heap_committed_bytes logstash_stats_jvm_threads_count logstash_stats_jvm_threads_peak_count logstash_stats_jvm_uptime_millis +logstash_stats_pipeline_up logstash_stats_pipeline_events_duration logstash_stats_pipeline_events_filtered logstash_stats_pipeline_events_in