From cf201bd36a755f0db7128900acc924ec086448e7 Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Fri, 22 Mar 2024 12:51:07 +0100 Subject: [PATCH] Missing metrics in Onramp (#630) --- .../ccip/internal/observability/onramp.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/services/ocr2/plugins/ccip/internal/observability/onramp.go b/core/services/ocr2/plugins/ccip/internal/observability/onramp.go index 57d9bcc53d..3312137d1a 100644 --- a/core/services/ocr2/plugins/ccip/internal/observability/onramp.go +++ b/core/services/ocr2/plugins/ccip/internal/observability/onramp.go @@ -4,6 +4,7 @@ import ( "context" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" + "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" ) @@ -42,3 +43,21 @@ func (o ObservedOnRampReader) GetDynamicConfig() (cciptypes.OnRampDynamicConfig, return o.OnRampReader.GetDynamicConfig() }) } + +func (o ObservedOnRampReader) IsSourceCursed(ctx context.Context) (bool, error) { + return withObservedInteraction(o.metric, "IsSourceCursed", func() (bool, error) { + return o.OnRampReader.IsSourceCursed(ctx) + }) +} + +func (o ObservedOnRampReader) IsSourceChainHealthy(ctx context.Context) (bool, error) { + return withObservedInteraction(o.metric, "IsSourceChainHealthy", func() (bool, error) { + return o.OnRampReader.IsSourceChainHealthy(ctx) + }) +} + +func (o ObservedOnRampReader) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) { + return withObservedInteraction(o.metric, "SourcePriceRegistryAddress", func() (cciptypes.Address, error) { + return o.OnRampReader.SourcePriceRegistryAddress(ctx) + }) +}