diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/jobs/drivers/amqp/rabbit_init.go | 8 | ||||
-rw-r--r-- | plugins/jobs/plugin.go | 2 | ||||
-rw-r--r-- | plugins/metrics/plugin.go | 9 |
3 files changed, 5 insertions, 14 deletions
diff --git a/plugins/jobs/drivers/amqp/rabbit_init.go b/plugins/jobs/drivers/amqp/rabbit_init.go index 570498e9..56ef10c8 100644 --- a/plugins/jobs/drivers/amqp/rabbit_init.go +++ b/plugins/jobs/drivers/amqp/rabbit_init.go @@ -1,10 +1,7 @@ package amqp import ( - "time" - "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2/pkg/events" ) func (j *JobConsumer) initRabbitMQ() error { @@ -56,10 +53,5 @@ func (j *JobConsumer) initRabbitMQ() error { return errors.E(op, err) } - j.eh.Push(events.JobEvent{ - Event: events.EventInitialized, - Driver: "amqp", - Start: time.Now(), - }) return channel.Close() } diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index 26015516..7707cb8a 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -553,8 +553,6 @@ func (p *Plugin) collectJobsEvents(event interface{}) { p.log.Error("pipeline error", "pipeline", jev.Pipeline, "error", jev.Error, "start", jev.Start.UTC(), "elapsed", jev.Elapsed) case events.EventDriverReady: p.log.Info("driver ready", "pipeline", jev.Pipeline, "start", jev.Start.UTC(), "elapsed", jev.Elapsed) - case events.EventInitialized: - p.log.Info("driver initialized", "driver", jev.Driver, "start", jev.Start.UTC()) } } } diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index 1f65e313..d285e609 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -8,6 +8,7 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spiral/errors" "github.com/spiral/roadrunner/v2/plugins/config" @@ -53,24 +54,24 @@ func (p *Plugin) Init(cfg config.Configurer, log logger.Logger) error { p.registry = prometheus.NewRegistry() // Default - err = p.registry.Register(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{})) + err = p.registry.Register(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{})) if err != nil { return errors.E(op, err) } // Default - err = p.registry.Register(prometheus.NewGoCollector()) + err = p.registry.Register(collectors.NewGoCollector()) if err != nil { return errors.E(op, err) } - collectors, err := p.cfg.getCollectors() + cl, err := p.cfg.getCollectors() if err != nil { return errors.E(op, err) } // Register invocation will be later in the Serve method - for k, v := range collectors { + for k, v := range cl { p.collectors.Store(k, v) } |