From 548ab96699c9b4422e95fa4d830c112667273bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Mon, 26 Feb 2024 23:37:52 +0100 Subject: [PATCH 1/5] refact(syslog-ng-ctl): extract createMetricsFromLegacyStats() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- pkg/syslog-ng-ctl/stats_prometheus.go | 158 ++++++++++++++------------ 1 file changed, 83 insertions(+), 75 deletions(-) diff --git a/pkg/syslog-ng-ctl/stats_prometheus.go b/pkg/syslog-ng-ctl/stats_prometheus.go index 5ce82b1..4cc446f 100644 --- a/pkg/syslog-ng-ctl/stats_prometheus.go +++ b/pkg/syslog-ng-ctl/stats_prometheus.go @@ -26,91 +26,99 @@ import ( "golang.org/x/exp/slices" ) -func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_client.MetricFamily, error) { - rsp, err := cc.SendCommand(ctx, "STATS PROMETHEUS") +func createMetricsFromLegacyStats(legacyStats string) (map[string]*io_prometheus_client.MetricFamily, error) { + var stats []Stat + var err error + + stats, err = parseStats(legacyStats) if err != nil { return nil, err } - var mfs map[string]*io_prometheus_client.MetricFamily - if strings.HasPrefix(rsp, StatsHeader) { - // received legacy-style stats - var stats []Stat - stats, err = parseStats(rsp) - if err != nil { - return nil, err - } - mfs = make(map[string]*io_prometheus_client.MetricFamily) - var errs []error - const metric_ns = "syslogng" - for _, stat := range stats { - switch { - case stat.SourceName == "global": - switch stat.SourceID { - case "scratch_buffers_count", "scratch_buffers_bytes": - if err := pushMetric(mfs, metric_ns+"_"+stat.SourceID, io_prometheus_client.MetricType_GAUGE, nil, float64(stat.Number)); err != nil { - errs = append(errs, err) - } - case "msg_allocated_bytes": - if err := pushMetric(mfs, metric_ns+"_events_allocated_bytes", io_prometheus_client.MetricType_GAUGE, nil, float64(stat.Number)); err != nil { - errs = append(errs, err) - } - default: - // ignore other global stats - } - case stat.SourceName == "filter": - labels := []*io_prometheus_client.LabelPair{ - newLabel("id", stat.SourceID), - newLabel("result", stat.Type), - } - if err := pushMetric(mfs, metric_ns+"_filtered_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + mfs := make(map[string]*io_prometheus_client.MetricFamily) + var errs []error + const metric_ns = "syslogng" + for _, stat := range stats { + switch { + case stat.SourceName == "global": + switch stat.SourceID { + case "scratch_buffers_count", "scratch_buffers_bytes": + if err := pushMetric(mfs, metric_ns+"_"+stat.SourceID, io_prometheus_client.MetricType_GAUGE, nil, float64(stat.Number)); err != nil { errs = append(errs, err) } - case strings.HasPrefix(stat.SourceName, "src.") && stat.SourceID != "" && stat.Type == "processed": - labels := []*io_prometheus_client.LabelPair{ - newLabel("id", stat.SourceID), - newLabel("result", stat.Type), - } - if stat.SourceInstance != "" { - labels = append(labels, newLabel("driver_instance", stat.SourceInstance)) - } - if err := pushMetric(mfs, metric_ns+"_input_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { - errs = append(errs, err) - } - case strings.HasPrefix(stat.SourceName, "dst.") && slices.Contains([]string{"dropped", "queued", "written"}, stat.Type): - result := stat.Type - if result == "written" { - result = "delivered" - } - labels := []*io_prometheus_client.LabelPair{ - newLabel("id", stat.SourceID), - newLabel("result", result), - } - if stat.SourceInstance != "" { - labels = append(labels, newLabel("driver_instance", stat.SourceInstance)) - } - if err := pushMetric(mfs, metric_ns+"_output_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { - errs = append(errs, err) - } - case stat.SourceName == "parser": - labels := []*io_prometheus_client.LabelPair{ - newLabel("id", stat.SourceID), - newLabel("result", stat.Type), - } - if err := pushMetric(mfs, metric_ns+"_parsed_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { - errs = append(errs, err) - } - case stat.SourceName == "tag": - labels := []*io_prometheus_client.LabelPair{ - newLabel("id", stat.SourceID), - newLabel("result", stat.Type), - } - if err := pushMetric(mfs, metric_ns+"_tagged_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + case "msg_allocated_bytes": + if err := pushMetric(mfs, metric_ns+"_events_allocated_bytes", io_prometheus_client.MetricType_GAUGE, nil, float64(stat.Number)); err != nil { errs = append(errs, err) } + default: + // ignore other global stats + } + case stat.SourceName == "filter": + labels := []*io_prometheus_client.LabelPair{ + newLabel("id", stat.SourceID), + newLabel("result", stat.Type), + } + if err := pushMetric(mfs, metric_ns+"_filtered_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + errs = append(errs, err) + } + case strings.HasPrefix(stat.SourceName, "src.") && stat.SourceID != "" && stat.Type == "processed": + labels := []*io_prometheus_client.LabelPair{ + newLabel("id", stat.SourceID), + newLabel("result", stat.Type), + } + if stat.SourceInstance != "" { + labels = append(labels, newLabel("driver_instance", stat.SourceInstance)) + } + if err := pushMetric(mfs, metric_ns+"_input_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + errs = append(errs, err) + } + case strings.HasPrefix(stat.SourceName, "dst.") && slices.Contains([]string{"dropped", "queued", "written"}, stat.Type): + result := stat.Type + if result == "written" { + result = "delivered" + } + labels := []*io_prometheus_client.LabelPair{ + newLabel("id", stat.SourceID), + newLabel("result", result), + } + if stat.SourceInstance != "" { + labels = append(labels, newLabel("driver_instance", stat.SourceInstance)) + } + if err := pushMetric(mfs, metric_ns+"_output_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + errs = append(errs, err) + } + case stat.SourceName == "parser": + labels := []*io_prometheus_client.LabelPair{ + newLabel("id", stat.SourceID), + newLabel("result", stat.Type), + } + if err := pushMetric(mfs, metric_ns+"_parsed_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + errs = append(errs, err) + } + case stat.SourceName == "tag": + labels := []*io_prometheus_client.LabelPair{ + newLabel("id", stat.SourceID), + newLabel("result", stat.Type), + } + if err := pushMetric(mfs, metric_ns+"_tagged_events_total", io_prometheus_client.MetricType_COUNTER, labels, float64(stat.Number)); err != nil { + errs = append(errs, err) } } - err = errors.Join(errs...) + } + + err = errors.Join(errs...) + return mfs, err +} + +func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_client.MetricFamily, error) { + rsp, err := cc.SendCommand(ctx, "STATS PROMETHEUS") + if err != nil { + return nil, err + } + + var mfs map[string]*io_prometheus_client.MetricFamily + if strings.HasPrefix(rsp, StatsHeader) { + mfs, err = createMetricsFromLegacyStats(rsp) } else { mfs, err = new(expfmt.TextParser).TextToMetricFamilies(strings.NewReader(rsp)) for _, mf := range mfs { From 86a9f26ccb14b8338656e60bdf071cbcc7c58c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Mon, 26 Feb 2024 23:39:26 +0100 Subject: [PATCH 2/5] refact(syslog-ng-ctl): early-return from StatsPrometheus() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- pkg/syslog-ng-ctl/stats_prometheus.go | 55 ++++++++++++++------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/pkg/syslog-ng-ctl/stats_prometheus.go b/pkg/syslog-ng-ctl/stats_prometheus.go index 4cc446f..67bbf56 100644 --- a/pkg/syslog-ng-ctl/stats_prometheus.go +++ b/pkg/syslog-ng-ctl/stats_prometheus.go @@ -119,37 +119,38 @@ func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_c var mfs map[string]*io_prometheus_client.MetricFamily if strings.HasPrefix(rsp, StatsHeader) { mfs, err = createMetricsFromLegacyStats(rsp) - } else { - mfs, err = new(expfmt.TextParser).TextToMetricFamilies(strings.NewReader(rsp)) - for _, mf := range mfs { - if mf.Type == nil { - continue - } - if *mf.Type != io_prometheus_client.MetricType_UNTYPED { - continue - } - if mf.Name == nil { - continue - } + return maps.Values(mfs), err + } + + mfs, err = new(expfmt.TextParser).TextToMetricFamilies(strings.NewReader(rsp)) + for _, mf := range mfs { + if mf.Type == nil { + continue + } + if *mf.Type != io_prometheus_client.MetricType_UNTYPED { + continue + } + if mf.Name == nil { + continue + } - switch { - case strings.HasSuffix(*mf.Name, "_events_total"): - for _, m := range mf.Metric { - m.Counter = &io_prometheus_client.Counter{ - Value: m.Untyped.Value, - } - m.Untyped = nil + switch { + case strings.HasSuffix(*mf.Name, "_events_total"): + for _, m := range mf.Metric { + m.Counter = &io_prometheus_client.Counter{ + Value: m.Untyped.Value, } - mf.Type = io_prometheus_client.MetricType_COUNTER.Enum() - default: - for _, m := range mf.Metric { - m.Gauge = &io_prometheus_client.Gauge{ - Value: m.Untyped.Value, - } - m.Untyped = nil + m.Untyped = nil + } + mf.Type = io_prometheus_client.MetricType_COUNTER.Enum() + default: + for _, m := range mf.Metric { + m.Gauge = &io_prometheus_client.Gauge{ + Value: m.Untyped.Value, } - mf.Type = io_prometheus_client.MetricType_GAUGE.Enum() + m.Untyped = nil } + mf.Type = io_prometheus_client.MetricType_GAUGE.Enum() } } From 8f834830230eb5328b55ee22cb8722d624376c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Tue, 27 Feb 2024 02:18:59 +0100 Subject: [PATCH 3/5] feat(syslog-ng-ctl): transform output_event_delay_sample_seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- go.mod | 9 +-- go.sum | 6 ++ go.work.sum | 82 ++++++++++++++++++++++ pkg/syslog-ng-ctl/controller.go | 6 +- pkg/syslog-ng-ctl/stats_prometheus.go | 63 ++++++++++++++++- pkg/syslog-ng-ctl/stats_prometheus_test.go | 76 +++++++++++++++++++- 6 files changed, 234 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 6b5ab8d..063ba77 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,14 @@ replace github.com/axoflow/axosyslog-metrics-exporter/pkg/syslog-ng-ctl => ./pkg require ( github.com/axoflow/axosyslog-metrics-exporter/pkg/syslog-ng-ctl v0.0.0-00010101000000-000000000000 - github.com/prometheus/common v0.44.0 + github.com/prometheus/common v0.46.0 ) require ( github.com/golang/protobuf v1.5.3 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect - google.golang.org/protobuf v1.30.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/prometheus v0.50.1 // indirect + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect + google.golang.org/protobuf v1.32.0 // indirect ) diff --git a/go.sum b/go.sum index f12ace8..4a6649b 100644 --- a/go.sum +++ b/go.sum @@ -10,15 +10,21 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/prometheus v0.50.1 h1:N2L+DYrxqPh4WZStU+o1p/gQlBaqFbcLBTjlp3vpdXw= +github.com/prometheus/prometheus v0.50.1/go.mod h1:FvE8dtQ1Ww63IlyKBn1V4s+zMwF9kHkVNkQBR1pM4CU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 h1:/yRP+0AN7mf5DkD3BAI6TOFnd51gEoDEb8o35jIFtgw= golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/go.work.sum b/go.work.sum index 383a670..c65ded9 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,7 +1,89 @@ +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/syslog-ng-ctl/controller.go b/pkg/syslog-ng-ctl/controller.go index f59ce6e..e6b2ae5 100644 --- a/pkg/syslog-ng-ctl/controller.go +++ b/pkg/syslog-ng-ctl/controller.go @@ -16,6 +16,7 @@ package syslogngctl import ( "context" + "time" io_prometheus_client "github.com/prometheus/client_model/go" ) @@ -24,7 +25,8 @@ import ( // // Reference for available commands in syslog-ng-ctl's source code: https://github.com/syslog-ng/syslog-ng/blob/0e7c762c704efbda0ae10b61c35700ef0bdbb9c1/syslog-ng-ctl/syslog-ng-ctl.c#L111 type Controller struct { - ControlChannel ControlChannel + ControlChannel ControlChannel + lastMetricQueryTime time.Time } func (c Controller) GetLicenseInfo(ctx context.Context) (string, error) { @@ -52,5 +54,5 @@ func (c Controller) PreprocessedConfig(ctx context.Context) (string, error) { } func (c Controller) StatsPrometheus(ctx context.Context) ([]*io_prometheus_client.MetricFamily, error) { - return StatsPrometheus(ctx, c.ControlChannel) + return StatsPrometheus(ctx, c.ControlChannel, &c.lastMetricQueryTime) } diff --git a/pkg/syslog-ng-ctl/stats_prometheus.go b/pkg/syslog-ng-ctl/stats_prometheus.go index 67bbf56..c6aa9e0 100644 --- a/pkg/syslog-ng-ctl/stats_prometheus.go +++ b/pkg/syslog-ng-ctl/stats_prometheus.go @@ -19,9 +19,11 @@ import ( "errors" "fmt" "strings" + "time" io_prometheus_client "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" + "github.com/prometheus/prometheus/model/timestamp" "golang.org/x/exp/maps" "golang.org/x/exp/slices" ) @@ -110,19 +112,68 @@ func createMetricsFromLegacyStats(legacyStats string) (map[string]*io_prometheus return mfs, err } -func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_client.MetricFamily, error) { +func transformEventDelayMetric(delayMetric *io_prometheus_client.MetricFamily, delayMetricAge *io_prometheus_client.MetricFamily, now time.Time, lastMetricQueryTime time.Time, mfs map[string]*io_prometheus_client.MetricFamily) { + + if delayMetricAge == nil { + delete(mfs, "syslogng_output_event_delay_sample_seconds") + return + } + + delayMetricAgeByLabel := make(map[string]*io_prometheus_client.Metric) + for _, a := range delayMetricAge.Metric { + delayMetricAgeByLabel[fmt.Sprint(a.Label)] = a + } + + transformedMetric := []*io_prometheus_client.Metric{} + for _, m := range delayMetric.Metric { + delayMetric := m + + if d, ok := delayMetricAgeByLabel[fmt.Sprint(m.Label)]; ok { + delayMetricAge := d.GetGauge().GetValue() + + lastDelaySampleTS := now.Add(time.Duration(-delayMetricAge * float64(time.Second))) + if lastDelaySampleTS.After(lastMetricQueryTime) { + timestampMs := timestamp.FromTime(lastDelaySampleTS) + transformedMetric = append(transformedMetric, + &io_prometheus_client.Metric{ + Label: delayMetric.GetLabel(), + Gauge: &io_prometheus_client.Gauge{Value: delayMetric.GetUntyped().Value}, + TimestampMs: ×tampMs, + }, + ) + } + } + } + + if len(transformedMetric) == 0 { + delete(mfs, "syslogng_output_event_delay_sample_seconds") + return + } + + delayMetric.Metric = transformedMetric + delayMetric.Type = io_prometheus_client.MetricType_GAUGE.Enum() +} + +func StatsPrometheus(ctx context.Context, cc ControlChannel, lastMetricQueryTime *time.Time) ([]*io_prometheus_client.MetricFamily, error) { rsp, err := cc.SendCommand(ctx, "STATS PROMETHEUS") if err != nil { return nil, err } + now := time.Now() + var mfs map[string]*io_prometheus_client.MetricFamily if strings.HasPrefix(rsp, StatsHeader) { mfs, err = createMetricsFromLegacyStats(rsp) + *lastMetricQueryTime = now return maps.Values(mfs), err } mfs, err = new(expfmt.TextParser).TextToMetricFamilies(strings.NewReader(rsp)) + + var delayMetric *io_prometheus_client.MetricFamily + var delayMetricAge *io_prometheus_client.MetricFamily + for _, mf := range mfs { if mf.Type == nil { continue @@ -143,6 +194,11 @@ func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_c m.Untyped = nil } mf.Type = io_prometheus_client.MetricType_COUNTER.Enum() + case mf.GetName() == "syslogng_output_event_delay_sample_seconds": + delayMetric = mf + case mf.GetName() == "syslogng_output_event_delay_sample_age_seconds": + delayMetricAge = mf + fallthrough default: for _, m := range mf.Metric { m.Gauge = &io_prometheus_client.Gauge{ @@ -154,6 +210,11 @@ func StatsPrometheus(ctx context.Context, cc ControlChannel) ([]*io_prometheus_c } } + if delayMetric != nil { + transformEventDelayMetric(delayMetric, delayMetricAge, now, *lastMetricQueryTime, mfs) + } + + *lastMetricQueryTime = now return maps.Values(mfs), err } diff --git a/pkg/syslog-ng-ctl/stats_prometheus_test.go b/pkg/syslog-ng-ctl/stats_prometheus_test.go index ba77a13..256c3b0 100644 --- a/pkg/syslog-ng-ctl/stats_prometheus_test.go +++ b/pkg/syslog-ng-ctl/stats_prometheus_test.go @@ -18,6 +18,7 @@ import ( "context" "strings" "testing" + "time" io_prometheus_client "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" @@ -245,6 +246,55 @@ func TestStatsPrometheus(t *testing.T) { } sortMetricFamilies(expected) + expectedDelayMetrics := []*io_prometheus_client.MetricFamily{ + { + Name: amp("syslogng_output_event_delay_sample_seconds"), + Type: io_prometheus_client.MetricType_GAUGE.Enum(), + Metric: []*io_prometheus_client.Metric{ + { + Label: []*io_prometheus_client.LabelPair{ + newLabel("driver", "http"), + newLabel("url", "http://localhost/asd"), + newLabel("id", "#anon-destination0#1"), + newLabel("worker", "0"), + }, + Gauge: &io_prometheus_client.Gauge{ + Value: amp(2.0), + }, + }, + }, + }, + { + Name: amp("syslogng_output_event_delay_sample_age_seconds"), + Type: io_prometheus_client.MetricType_GAUGE.Enum(), + Metric: []*io_prometheus_client.Metric{ + { + Label: []*io_prometheus_client.LabelPair{ + newLabel("driver", "http"), + newLabel("url", "http://localhost/asd"), + newLabel("id", "#anon-destination0#1"), + newLabel("worker", "0"), + }, + Gauge: &io_prometheus_client.Gauge{ + Value: amp(1.0), + }, + }, + { + Label: []*io_prometheus_client.LabelPair{ + newLabel("transport", "tcp"), + newLabel("address", "localhost:5555"), + newLabel("driver", "afsocket"), + newLabel("id", "#anon-destination0#0"), + }, + Gauge: &io_prometheus_client.Gauge{ + Value: amp(31.0), + }, + }, + }, + }, + } + sortMetricFamilies(expectedDelayMetrics) + testCases := map[string]struct { cc ControlChannel expected []*io_prometheus_client.MetricFamily @@ -263,13 +313,23 @@ func TestStatsPrometheus(t *testing.T) { }), expected: expected, }, + "syslog-ng stats prometheus delay metrics": { + cc: ControlChannelFunc(func(_ context.Context, cmd string) (rsp string, err error) { + require.Equal(t, "STATS PROMETHEUS", cmd) + return PROMETHEUS_DELAY_METRICS_OUTPUT, nil + }), + expected: expectedDelayMetrics, + }, } + for name, testCase := range testCases { testCase := testCase t.Run(name, func(t *testing.T) { - res, err := StatsPrometheus(context.Background(), testCase.cc) + lastMetricQueryTime := time.Now().Add(-time.Second * 30) + res, err := StatsPrometheus(context.Background(), testCase.cc, &lastMetricQueryTime) require.NoError(t, err) sortMetricFamilies(res) + removeTimestamps(res) if !assert.ElementsMatch(t, testCase.expected, res) { assert.Equal(t, metricFamiliesToText(testCase.expected), metricFamiliesToText(res)) } @@ -392,6 +452,12 @@ syslogng_tagged_events_total{id=".source.#anon-source0",result="processed"} 0 syslogng_tagged_events_total{id=".source.s_network",result="processed"} 0 ` +const PROMETHEUS_DELAY_METRICS_OUTPUT = `syslogng_output_event_delay_sample_seconds{transport="tcp",address="localhost:5555",driver="afsocket",id="#anon-destination0#0"} 5 +syslogng_output_event_delay_sample_seconds{driver="http",url="http://localhost/asd",id="#anon-destination0#1",worker="0"} 2 +syslogng_output_event_delay_sample_age_seconds{driver="http",url="http://localhost/asd",id="#anon-destination0#1",worker="0"} 1 +syslogng_output_event_delay_sample_age_seconds{transport="tcp",address="localhost:5555",driver="afsocket",id="#anon-destination0#0"} 31 +` + func metricFamiliesToText(mfs []*io_prometheus_client.MetricFamily) string { var buf strings.Builder for _, mf := range mfs { @@ -421,6 +487,14 @@ func sortMetricFamilies(mfs []*io_prometheus_client.MetricFamily) { } } +func removeTimestamps(mfs []*io_prometheus_client.MetricFamily) { + for _, mf := range mfs { + for _, m := range mf.Metric { + m.TimestampMs = nil + } + } +} + func amp[T any](v T) *T { return &v } From 342649d3d6c7afcf7be990a28e0790cbc506b323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Thu, 29 Feb 2024 12:31:54 +0100 Subject: [PATCH 4/5] chore(syslog-ng-ctl): do not compare unexported fields in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Metrics are protobuf structs, they contain internal state, which should not be compared. For example, a simple `fmt.Sprint(metric.Label)` call can change the internal state of `metric`. Signed-off-by: László Várady --- pkg/syslog-ng-ctl/stats_prometheus_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/syslog-ng-ctl/stats_prometheus_test.go b/pkg/syslog-ng-ctl/stats_prometheus_test.go index 256c3b0..ee8e686 100644 --- a/pkg/syslog-ng-ctl/stats_prometheus_test.go +++ b/pkg/syslog-ng-ctl/stats_prometheus_test.go @@ -20,6 +20,8 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" io_prometheus_client "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" "github.com/stretchr/testify/assert" @@ -330,7 +332,7 @@ func TestStatsPrometheus(t *testing.T) { require.NoError(t, err) sortMetricFamilies(res) removeTimestamps(res) - if !assert.ElementsMatch(t, testCase.expected, res) { + if !cmp.Equal(t, testCase.expected, cmpopts.IgnoreUnexported()) { assert.Equal(t, metricFamiliesToText(testCase.expected), metricFamiliesToText(res)) } }) From 873168c80a601e912b50e710c6a3627da55dddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Thu, 29 Feb 2024 12:46:07 +0100 Subject: [PATCH 5/5] build: go mod tidy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- go.mod | 4 +--- go.sum | 29 +++++++---------------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 063ba77..0ef8658 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,11 @@ replace github.com/axoflow/axosyslog-metrics-exporter/pkg/syslog-ng-ctl => ./pkg require ( github.com/axoflow/axosyslog-metrics-exporter/pkg/syslog-ng-ctl v0.0.0-00010101000000-000000000000 github.com/prometheus/common v0.46.0 + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a ) require ( - github.com/golang/protobuf v1.5.3 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/prometheus v0.50.1 // indirect - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect google.golang.org/protobuf v1.32.0 // indirect ) diff --git a/go.sum b/go.sum index 4a6649b..298afa1 100644 --- a/go.sum +++ b/go.sum @@ -1,30 +1,15 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/prometheus v0.50.1 h1:N2L+DYrxqPh4WZStU+o1p/gQlBaqFbcLBTjlp3vpdXw= github.com/prometheus/prometheus v0.50.1/go.mod h1:FvE8dtQ1Ww63IlyKBn1V4s+zMwF9kHkVNkQBR1pM4CU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 h1:/yRP+0AN7mf5DkD3BAI6TOFnd51gEoDEb8o35jIFtgw= -golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=