From 375b3c5e6ecc15ad8ba830de41b12613b24e2c54 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Fri, 6 Dec 2024 08:17:48 +0100 Subject: [PATCH] Adding OCR3 metrics promwrapper to LLO --- core/services/llo/delegate.go | 18 ++++++++++++++++-- core/services/ocr2/delegate.go | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/services/llo/delegate.go b/core/services/llo/delegate.go index d305fe0e948..406d321e098 100644 --- a/core/services/llo/delegate.go +++ b/core/services/llo/delegate.go @@ -21,6 +21,7 @@ import ( corelogger "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr3/promwrapper" "github.com/smartcontractkit/chainlink/v2/core/services/streams" ) @@ -59,6 +60,7 @@ type DelegateConfig struct { ShouldRetireCache datastreamsllo.ShouldRetireCache EAMonitoringEndpoint ocrcommontypes.MonitoringEndpoint DonID uint32 + ChainID string // OCR3 TraceLogging bool @@ -151,8 +153,20 @@ func (d *delegate) Start(ctx context.Context) error { OffchainConfigDigester: d.cfg.OffchainConfigDigester, OffchainKeyring: d.cfg.OffchainKeyring, OnchainKeyring: d.cfg.OnchainKeyring, - ReportingPluginFactory: datastreamsllo.NewPluginFactory( - d.cfg.ReportingPluginConfig, psrrc, d.src, d.cfg.RetirementReportCodec, d.cfg.ChannelDefinitionCache, d.ds, logger.Named(lggr, "ReportingPlugin"), llo.EVMOnchainConfigCodec{}, d.reportCodecs, + ReportingPluginFactory: promwrapper.NewReportingPluginFactory( + datastreamsllo.NewPluginFactory( + d.cfg.ReportingPluginConfig, + psrrc, + d.src, + d.cfg.RetirementReportCodec, + d.cfg.ChannelDefinitionCache, + d.ds, + logger.Named(lggr, "ReportingPlugin"), + llo.EVMOnchainConfigCodec{}, + d.reportCodecs, + ), + d.cfg.ChainID, + "llo", ), MetricsRegisterer: prometheus.WrapRegistererWith(map[string]string{"job_name": d.cfg.JobName.ValueOrZero()}, prometheus.DefaultRegisterer), }) diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index e7a5a1c3a92..83227f9c6d4 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -1048,6 +1048,7 @@ func (d *Delegate) newServicesLLO( RetirementReportCodec: datastreamsllo.StandardRetirementReportCodec{}, EAMonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, telemetryContractID, synchronization.EnhancedEAMercury), DonID: pluginCfg.DonID, + ChainID: spec.ChainID, TraceLogging: d.cfg.OCR2().TraceLogging(), BinaryNetworkEndpointFactory: d.peerWrapper.Peer2,