From d74dd7e4f97f473e681610d21d69db1d5f038b9e Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Fri, 1 Nov 2024 16:29:17 -0400 Subject: [PATCH 01/12] Adds beholder logging --- core/capabilities/compute/compute.go | 39 ++++++++++++++++++------- core/capabilities/compute/monitoring.go | 10 +++++++ 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 core/capabilities/compute/monitoring.go diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 3527199cdb2..f145a2ed5b3 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "net/http" "strings" "time" @@ -21,6 +22,7 @@ import ( coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" wasmpb "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/pb" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" @@ -117,7 +119,7 @@ func (c *Compute) Execute(ctx context.Context, request capabilities.CapabilityRe m, ok := c.modules.get(id) if !ok { - mod, err := c.initModule(id, cfg.ModuleConfig, cfg.Binary, request.Metadata.WorkflowID, request.Metadata.WorkflowExecutionID, request.Metadata.ReferenceID) + mod, err := c.initModule(id, cfg.ModuleConfig, cfg.Binary, request.Metadata) if err != nil { return capabilities.CapabilityResponse{}, err } @@ -128,10 +130,10 @@ func (c *Compute) Execute(ctx context.Context, request capabilities.CapabilityRe return c.executeWithModule(ctx, m.module, cfg.Config, request) } -func (c *Compute) initModule(id string, cfg *host.ModuleConfig, binary []byte, workflowID, workflowExecutionID, referenceID string) (*module, error) { +func (c *Compute) initModule(id string, cfg *host.ModuleConfig, binary []byte, requestMetadata capabilities.RequestMetadata) (*module, error) { initStart := time.Now() - cfg.Fetch = c.createFetcher(workflowID, workflowExecutionID) + cfg.Fetch = c.createFetcher(requestMetadata) mod, err := host.NewModule(cfg, binary) if err != nil { return nil, fmt.Errorf("failed to instantiate WASM module: %w", err) @@ -140,7 +142,7 @@ func (c *Compute) initModule(id string, cfg *host.ModuleConfig, binary []byte, w mod.Start() initDuration := time.Since(initStart) - computeWASMInit.WithLabelValues(workflowID, referenceID).Observe(float64(initDuration)) + computeWASMInit.WithLabelValues(requestMetadata.WorkflowID, requestMetadata.ReferenceID).Observe(float64(initDuration)) m := &module{module: mod} c.modules.add(id, m) @@ -201,18 +203,26 @@ func (c *Compute) Close() error { return nil } -func (c *Compute) createFetcher(workflowID, workflowExecutionID string) func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { +func (c *Compute) createFetcher(requestMetadata capabilities.RequestMetadata) func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { return func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { - if err := validation.ValidateWorkflowOrExecutionID(workflowID); err != nil { - return nil, fmt.Errorf("workflow ID %q is invalid: %w", workflowID, err) + if err := validation.ValidateWorkflowOrExecutionID(requestMetadata.WorkflowID); err != nil { + return nil, fmt.Errorf("workflow ID %q is invalid: %w", requestMetadata.WorkflowID, err) } - if err := validation.ValidateWorkflowOrExecutionID(workflowExecutionID); err != nil { - return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", workflowExecutionID, err) + if err := validation.ValidateWorkflowOrExecutionID(requestMetadata.WorkflowExecutionID); err != nil { + return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", requestMetadata.WorkflowExecutionID, err) } + cma := c.emitter.With( + wIDKey, requestMetadata.WorkflowID, + wnKey, requestMetadata.WorkflowName, + woIDKey, requestMetadata.WorkflowOwner, + eIDKey, requestMetadata.WorkflowExecutionID, + timestampKey, time.Now().UTC().Format(time.RFC3339Nano), + ) + messageID := strings.Join([]string{ - workflowID, - workflowExecutionID, + requestMetadata.WorkflowID, + requestMetadata.WorkflowExecutionID, ghcapabilities.MethodComputeAction, c.idGenerator(), }, "/") @@ -245,6 +255,13 @@ func (c *Compute) createFetcher(workflowID, workflowExecutionID string) func(ctx if err != nil { return nil, fmt.Errorf("failed to unmarshal fetch response: %w", err) } + if response.StatusCode != http.StatusOK { + msg := fmt.Sprintf("compute fetch request failed with status code %d", response.StatusCode) + err = cma.Emit(ctx, msg) + if err != nil { + c.log.Errorf("failed to send custom message with msg: %s, err: %v", msg, err) + } + } return &response, nil } } diff --git a/core/capabilities/compute/monitoring.go b/core/capabilities/compute/monitoring.go new file mode 100644 index 00000000000..b97adf1364c --- /dev/null +++ b/core/capabilities/compute/monitoring.go @@ -0,0 +1,10 @@ +package compute + +// Observability keys +const ( + wIDKey = "workflowID" + eIDKey = "workflowExecutionID" + wnKey = "workflowName" + woIDKey = "workflowOwner" + timestampKey = "computeTimestamp" +) From 5b22b6c44ad4769695d3d40289d0c5a00fbf51b0 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 11:30:22 -0400 Subject: [PATCH 02/12] Bumps `common` --- core/capabilities/compute/compute.go | 24 ++++++++++++------------ go.mod | 2 +- go.sum | 4 ++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index f145a2ed5b3..c38d35d01a5 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -133,7 +133,7 @@ func (c *Compute) Execute(ctx context.Context, request capabilities.CapabilityRe func (c *Compute) initModule(id string, cfg *host.ModuleConfig, binary []byte, requestMetadata capabilities.RequestMetadata) (*module, error) { initStart := time.Now() - cfg.Fetch = c.createFetcher(requestMetadata) + cfg.Fetch = c.createFetcher() mod, err := host.NewModule(cfg, binary) if err != nil { return nil, fmt.Errorf("failed to instantiate WASM module: %w", err) @@ -203,26 +203,26 @@ func (c *Compute) Close() error { return nil } -func (c *Compute) createFetcher(requestMetadata capabilities.RequestMetadata) func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { +func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { return func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { - if err := validation.ValidateWorkflowOrExecutionID(requestMetadata.WorkflowID); err != nil { - return nil, fmt.Errorf("workflow ID %q is invalid: %w", requestMetadata.WorkflowID, err) + if err := validation.ValidateWorkflowOrExecutionID(req.WorkflowId); err != nil { + return nil, fmt.Errorf("workflow ID %q is invalid: %w", req.WorkflowId, err) } - if err := validation.ValidateWorkflowOrExecutionID(requestMetadata.WorkflowExecutionID); err != nil { - return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", requestMetadata.WorkflowExecutionID, err) + if err := validation.ValidateWorkflowOrExecutionID(req.WorkflowExecutionId); err != nil { + return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", req.WorkflowExecutionId, err) } cma := c.emitter.With( - wIDKey, requestMetadata.WorkflowID, - wnKey, requestMetadata.WorkflowName, - woIDKey, requestMetadata.WorkflowOwner, - eIDKey, requestMetadata.WorkflowExecutionID, + wIDKey, req.WorkflowId, + wnKey, req.WorkflowName, + woIDKey, req.WorkflowOwner, + eIDKey, req.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), ) messageID := strings.Join([]string{ - requestMetadata.WorkflowID, - requestMetadata.WorkflowExecutionID, + req.WorkflowId, + req.WorkflowExecutionId, ghcapabilities.MethodComputeAction, c.idGenerator(), }, "/") diff --git a/go.mod b/go.mod index 03084edf658..cd395d67926 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index c9ffda30070..8e9276035f6 100644 --- a/go.sum +++ b/go.sum @@ -1079,6 +1079,10 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac8 h1:201Qzwo1CdzrP5z4fiyUPeXGhtmzojmFRw/WWaI5TLc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac8/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb h1:7aIxwoLaTqMhBluqqhnCxRlrfBWvsOk+oNAWzY7ESxk= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From e0f6f2dd0eccca327044a3b50501d57ec267b871 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 12:02:57 -0400 Subject: [PATCH 03/12] Bumps `common` --- core/capabilities/compute/compute.go | 25 ++++++++++++++----------- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index c38d35d01a5..927d3fa4d83 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -205,24 +205,24 @@ func (c *Compute) Close() error { func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { return func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) { - if err := validation.ValidateWorkflowOrExecutionID(req.WorkflowId); err != nil { - return nil, fmt.Errorf("workflow ID %q is invalid: %w", req.WorkflowId, err) + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowId); err != nil { + return nil, fmt.Errorf("workflow ID %q is invalid: %w", req.Metadata.WorkflowId, err) } - if err := validation.ValidateWorkflowOrExecutionID(req.WorkflowExecutionId); err != nil { - return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", req.WorkflowExecutionId, err) + if err := validation.ValidateWorkflowOrExecutionID(req.Metadata.WorkflowExecutionId); err != nil { + return nil, fmt.Errorf("workflow execution ID %q is invalid: %w", req.Metadata.WorkflowExecutionId, err) } cma := c.emitter.With( - wIDKey, req.WorkflowId, - wnKey, req.WorkflowName, - woIDKey, req.WorkflowOwner, - eIDKey, req.WorkflowExecutionId, + wIDKey, req.Metadata.WorkflowId, + wnKey, req.Metadata.WorkflowName, + woIDKey, req.Metadata.WorkflowOwner, + eIDKey, req.Metadata.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), ) messageID := strings.Join([]string{ - req.WorkflowId, - req.WorkflowExecutionId, + req.Metadata.WorkflowId, + req.Metadata.WorkflowExecutionId, ghcapabilities.MethodComputeAction, c.idGenerator(), }, "/") @@ -255,13 +255,16 @@ func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchReq if err != nil { return nil, fmt.Errorf("failed to unmarshal fetch response: %w", err) } - if response.StatusCode != http.StatusOK { + + // Only log if the response is not in the 200 range + if response.StatusCode < http.StatusOK || response.StatusCode >= http.StatusMultipleChoices { msg := fmt.Sprintf("compute fetch request failed with status code %d", response.StatusCode) err = cma.Emit(ctx, msg) if err != nil { c.log.Errorf("failed to send custom message with msg: %s, err: %v", msg, err) } } + return &response, nil } } diff --git a/go.mod b/go.mod index cd395d67926..ef669ed94d0 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index 8e9276035f6..e67610f5522 100644 --- a/go.sum +++ b/go.sum @@ -1083,6 +1083,8 @@ github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac8/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb h1:7aIxwoLaTqMhBluqqhnCxRlrfBWvsOk+oNAWzY7ESxk= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175 h1:hFxTPuxQUeH8WhTMxVWqec1YJew4yoU9scnI6EaU1tA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From d8422c88ca12da4b6e62a60d99fa20ade767aa85 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 12:34:39 -0400 Subject: [PATCH 04/12] Bumps `common` --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ef669ed94d0..b72750556bb 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index e67610f5522..2557fcf80e6 100644 --- a/go.sum +++ b/go.sum @@ -1085,6 +1085,8 @@ github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bc github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175 h1:hFxTPuxQUeH8WhTMxVWqec1YJew4yoU9scnI6EaU1tA= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From 707c75273e5191092534097e759c58d8d2b5ac19 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 12:43:49 -0400 Subject: [PATCH 05/12] Improves var naming --- core/capabilities/compute/compute.go | 8 +-- core/capabilities/compute/monitoring.go | 10 ++-- core/services/workflows/delegate.go | 2 +- core/services/workflows/engine.go | 72 ++++++++++++------------- core/services/workflows/engine_test.go | 15 +++--- core/services/workflows/monitoring.go | 18 +++---- 6 files changed, 63 insertions(+), 62 deletions(-) diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 927d3fa4d83..82d58f0525e 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -213,10 +213,10 @@ func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchReq } cma := c.emitter.With( - wIDKey, req.Metadata.WorkflowId, - wnKey, req.Metadata.WorkflowName, - woIDKey, req.Metadata.WorkflowOwner, - eIDKey, req.Metadata.WorkflowExecutionId, + workflowIDKey, req.Metadata.WorkflowId, + workflowNameKey, req.Metadata.WorkflowName, + workflowOwnerKey, req.Metadata.WorkflowOwner, + workflowExecutionIDKey, req.Metadata.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), ) diff --git a/core/capabilities/compute/monitoring.go b/core/capabilities/compute/monitoring.go index b97adf1364c..d81cabc9873 100644 --- a/core/capabilities/compute/monitoring.go +++ b/core/capabilities/compute/monitoring.go @@ -2,9 +2,9 @@ package compute // Observability keys const ( - wIDKey = "workflowID" - eIDKey = "workflowExecutionID" - wnKey = "workflowName" - woIDKey = "workflowOwner" - timestampKey = "computeTimestamp" + workflowIDKey = "workflowID" + workflowExecutionIDKey = "workflowExecutionID" + workflowNameKey = "workflowName" + workflowOwnerKey = "workflowOwner" + timestampKey = "computeTimestamp" ) diff --git a/core/services/workflows/delegate.go b/core/services/workflows/delegate.go index 7cba967115e..cd8a37764a0 100644 --- a/core/services/workflows/delegate.go +++ b/core/services/workflows/delegate.go @@ -39,7 +39,7 @@ func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error) { - cma := custmsg.NewLabeler().With(wIDKey, spec.WorkflowSpec.WorkflowID, woIDKey, spec.WorkflowSpec.WorkflowOwner, wnKey, spec.WorkflowSpec.WorkflowName) + cma := custmsg.NewLabeler().With(workflowIDKey, spec.WorkflowSpec.WorkflowID, workflowOwnerKey, spec.WorkflowSpec.WorkflowOwner, workflowNameKey, spec.WorkflowSpec.WorkflowName) sdkSpec, err := spec.WorkflowSpec.SDKSpec(ctx) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to start workflow engine: failed to get workflow sdk spec: %v", err), d.logger) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index cdcc7909d36..e9148773fb7 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -167,9 +167,9 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { for _, t := range e.workflow.triggers { tg, err := e.registry.GetTrigger(ctx, t.ID) if err != nil { - log := e.logger.With(cIDKey, t.ID) + log := e.logger.With(capabilityIDKey, t.ID) log.Errorf("failed to get trigger capability: %s", err) - logCustMsg(ctx, e.cma.With(cIDKey, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) + logCustMsg(ctx, e.cma.With(capabilityIDKey, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) // we don't immediately return here, since we want to retry all triggers // to notify the user of all errors at once. triggersInitialized = false @@ -179,7 +179,7 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { } if !triggersInitialized { return &workflowError{reason: "failed to resolve triggers", labels: map[string]string{ - wIDKey: e.workflow.id, + workflowIDKey: e.workflow.id, }} } @@ -201,15 +201,15 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { if err != nil { logCustMsg( ctx, - e.cma.With(wIDKey, e.workflow.id, sIDKey, s.ID, sRKey, s.Ref), + e.cma.With(workflowIDKey, e.workflow.id, stepIDKey, s.ID, stepRefKey, s.Ref), fmt.Sprintf("failed to initialize capability for step: %s", err), e.logger, ) return &workflowError{err: err, reason: "failed to initialize capability for step", labels: map[string]string{ - wIDKey: e.workflow.id, - sIDKey: s.ID, - sRKey: s.Ref, + workflowIDKey: e.workflow.id, + stepIDKey: s.ID, + stepRefKey: s.Ref, }} } @@ -231,8 +231,8 @@ func (e *Engine) initializeCapability(ctx context.Context, step *step) error { } return &workflowError{reason: reason, err: err, labels: map[string]string{ - wIDKey: e.workflow.id, - sIDKey: step.ID, + workflowIDKey: e.workflow.id, + stepIDKey: step.ID, }} } @@ -318,7 +318,7 @@ func (e *Engine) init(ctx context.Context) { if err != nil { return &workflowError{err: err, reason: "failed to resolve workflow capabilities", labels: map[string]string{ - wIDKey: e.workflow.id, + workflowIDKey: e.workflow.id, }} } return nil @@ -341,9 +341,9 @@ func (e *Engine) init(ctx context.Context) { for idx, t := range e.workflow.triggers { terr := e.registerTrigger(ctx, t, idx) if terr != nil { - log := e.logger.With(cIDKey, t.ID) + log := e.logger.With(capabilityIDKey, t.ID) log.Errorf("failed to register trigger: %s", terr) - logCustMsg(ctx, e.cma.With(cIDKey, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) + logCustMsg(ctx, e.cma.With(capabilityIDKey, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) } } @@ -451,9 +451,9 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // and triggerID might be "wf_123_trigger_0" return &workflowError{err: err, reason: fmt.Sprintf("failed to register trigger: %+v", triggerRegRequest), labels: map[string]string{ - wIDKey: e.workflow.id, - cIDKey: t.ID, - tIDKey: triggerID, + workflowIDKey: e.workflow.id, + capabilityIDKey: t.ID, + triggerIDKey: triggerID, }} } @@ -491,7 +491,7 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // `executionState`. func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpdateCh chan store.WorkflowExecutionStep, workflowCreatedAt *time.Time) { defer e.wg.Done() - lggr := e.logger.With(eIDKey, executionID) + lggr := e.logger.With(workflowExecutionIDKey, executionID) e.logger.Debugf("running stepUpdateLoop for execution %s", executionID) for { select { @@ -505,11 +505,11 @@ func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpd } // Executed synchronously to ensure we correctly schedule subsequent tasks. e.logger.Debugw(fmt.Sprintf("received step update for execution %s", stepUpdate.ExecutionID), - eIDKey, stepUpdate.ExecutionID, sRKey, stepUpdate.Ref) + workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) err := e.handleStepUpdate(ctx, stepUpdate, workflowCreatedAt) if err != nil { e.logger.Errorf(fmt.Sprintf("failed to update step state: %+v, %s", stepUpdate, err), - eIDKey, stepUpdate.ExecutionID, sRKey, stepUpdate.Ref) + workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) } } } @@ -532,7 +532,7 @@ func generateExecutionID(workflowID, eventID string) (string, error) { // startExecution kicks off a new workflow execution when a trigger event is received. func (e *Engine) startExecution(ctx context.Context, executionID string, event *values.Map) error { - lggr := e.logger.With("event", event, eIDKey, executionID) + lggr := e.logger.With("event", event, workflowExecutionIDKey, executionID) lggr.Debug("executing on a trigger event") ec := &store.WorkflowExecution{ Steps: map[string]*store.WorkflowExecutionStep{ @@ -584,8 +584,8 @@ func (e *Engine) startExecution(ctx context.Context, executionID string, event * } func (e *Engine) handleStepUpdate(ctx context.Context, stepUpdate store.WorkflowExecutionStep, workflowCreatedAt *time.Time) error { - l := e.logger.With(eIDKey, stepUpdate.ExecutionID, sRKey, stepUpdate.Ref) - cma := e.cma.With(eIDKey, stepUpdate.ExecutionID, sRKey, stepUpdate.Ref) + l := e.logger.With(workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) + cma := e.cma.With(workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) // If we've been executing for too long, let's time the workflow step out and continue. if workflowCreatedAt != nil && e.clock.Since(*workflowCreatedAt) > e.maxExecutionDuration { @@ -658,7 +658,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { // If all dependencies are completed, enqueue the step. if !waitingOnDependencies { - e.logger.With(sRKey, step.Ref, eIDKey, state.ExecutionID, "state", copyState(state)). + e.logger.With(stepRefKey, step.Ref, workflowExecutionIDKey, state.ExecutionID, "state", copyState(state)). Debug("step request enqueued") e.pendingStepRequests <- stepRequest{ state: copyState(state), @@ -668,7 +668,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { } func (e *Engine) finishExecution(ctx context.Context, executionID string, status string) error { - e.logger.With(eIDKey, executionID, "status", status).Info("finishing execution") + e.logger.With(workflowExecutionIDKey, executionID, "status", status).Info("finishing execution") metrics := e.metrics.with("status", status) err := e.executionStates.UpdateStatus(ctx, executionID, status) if err != nil { @@ -713,23 +713,23 @@ func (e *Engine) worker(ctx context.Context) { te := resp.Event if te.ID == "" { - e.logger.With(tIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") + e.logger.With(triggerIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") continue } executionID, err := generateExecutionID(e.workflow.id, te.ID) if err != nil { - e.logger.With(tIDKey, te.ID).Errorf("could not generate execution ID: %v", err) + e.logger.With(triggerIDKey, te.ID).Errorf("could not generate execution ID: %v", err) continue } - cma := e.cma.With(eIDKey, executionID) + cma := e.cma.With(workflowExecutionIDKey, executionID) err = e.startExecution(ctx, executionID, resp.Event.Outputs) if err != nil { - e.logger.With(eIDKey, executionID).Errorf("failed to start execution: %v", err) + e.logger.With(workflowExecutionIDKey, executionID).Errorf("failed to start execution: %v", err) logCustMsg(ctx, cma, fmt.Sprintf("failed to start execution: %s", err), e.logger) } else { - e.logger.With(eIDKey, executionID).Debug("execution started") + e.logger.With(workflowExecutionIDKey, executionID).Debug("execution started") logCustMsg(ctx, cma, "execution started", e.logger) } case <-ctx.Done(): @@ -741,8 +741,8 @@ func (e *Engine) worker(ctx context.Context) { func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) { // Instantiate a child logger; in addition to the WorkflowID field the workflow // logger will already have, this adds the `stepRef` and `executionID` - l := e.logger.With(sRKey, msg.stepRef, eIDKey, msg.state.ExecutionID) - cma := e.cma.With(sRKey, msg.stepRef, eIDKey, msg.state.ExecutionID) + l := e.logger.With(stepRefKey, msg.stepRef, workflowExecutionIDKey, msg.state.ExecutionID) + cma := e.cma.With(stepRefKey, msg.stepRef, workflowExecutionIDKey, msg.state.ExecutionID) l.Debug("executing on a step event") stepState := &store.WorkflowExecutionStep{ @@ -1104,9 +1104,9 @@ func (e *Engine) Close() error { return &workflowError{err: innerErr, reason: fmt.Sprintf("failed to unregister capability from workflow: %+v", reg), labels: map[string]string{ - wIDKey: e.workflow.id, - sIDKey: s.ID, - sRKey: s.Ref, + workflowIDKey: e.workflow.id, + stepIDKey: s.ID, + stepRefKey: s.Ref, }} } @@ -1157,7 +1157,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { if cfg.Store == nil { return nil, &workflowError{reason: "store is nil", labels: map[string]string{ - wIDKey: cfg.WorkflowID, + workflowIDKey: cfg.WorkflowID, }, } } @@ -1206,7 +1206,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { // - that the resulting graph is strongly connected (i.e. no disjointed subgraphs exist) // - etc. - cma := custmsg.NewLabeler().With(wIDKey, cfg.WorkflowID, woIDKey, cfg.WorkflowOwner, wnKey, cfg.WorkflowName) + cma := custmsg.NewLabeler().With(workflowIDKey, cfg.WorkflowID, workflowOwnerKey, cfg.WorkflowOwner, workflowNameKey, cfg.WorkflowName) workflow, err := Parse(cfg.Workflow) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to parse workflow: %s", err), cfg.Lggr) @@ -1220,7 +1220,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { engine = &Engine{ cma: cma, logger: cfg.Lggr.Named("WorkflowEngine").With("workflowID", cfg.WorkflowID), - metrics: workflowsMetricLabeler{metrics.NewLabeler().With(wIDKey, cfg.WorkflowID, woIDKey, cfg.WorkflowOwner, wnKey, workflow.name)}, + metrics: workflowsMetricLabeler{metrics.NewLabeler().With(workflowIDKey, cfg.WorkflowID, workflowOwnerKey, cfg.WorkflowOwner, workflowNameKey, workflow.name)}, registry: cfg.Registry, workflow: workflow, secretsFetcher: cfg.SecretsFetcher, diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 13f7bbd9d49..15dc7f488e9 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows" "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi" gcmocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector/mocks" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" @@ -973,26 +974,26 @@ func TestEngine_Error(t *testing.T) { }{ { name: "Error with error and reason", - labels: map[string]string{wIDKey: "my-workflow-id"}, + labels: map[string]string{workflowIDKey: "my-workflow-id"}, err: err, reason: "some reason", want: "workflowID my-workflow-id: some reason: some error", }, { name: "Error with error and no reason", - labels: map[string]string{eIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, + labels: map[string]string{workflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, err: err, want: "workflowExecutionID dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751: some error", }, { name: "Error with no error and reason", - labels: map[string]string{cIDKey: "streams-trigger:network_eth@1.0.0"}, + labels: map[string]string{capabilityIDKey: "streams-trigger:network_eth@1.0.0"}, reason: "some reason", want: "capabilityID streams-trigger:network_eth@1.0.0: some reason", }, { name: "Error with no error and no reason", - labels: map[string]string{tIDKey: "wf_123_trigger_456"}, + labels: map[string]string{triggerIDKey: "wf_123_trigger_456"}, want: "triggerID wf_123_trigger_456: ", }, { @@ -1005,9 +1006,9 @@ func TestEngine_Error(t *testing.T) { { name: "Multiple labels", labels: map[string]string{ - wIDKey: "my-workflow-id", - eIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", - cIDKey: "streams-trigger:network_eth@1.0.0", + workflowIDKey: "my-workflow-id", + workflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", + capabilityIDKey: "streams-trigger:network_eth@1.0.0", }, err: err, reason: "some reason", diff --git a/core/services/workflows/monitoring.go b/core/services/workflows/monitoring.go index bd448afd9e5..16679f60b4d 100644 --- a/core/services/workflows/monitoring.go +++ b/core/services/workflows/monitoring.go @@ -95,14 +95,14 @@ func (c workflowsMetricLabeler) incrementEngineHeartbeatCounter(ctx context.Cont // Observability keys const ( - cIDKey = "capabilityID" - tIDKey = "triggerID" - wIDKey = "workflowID" - eIDKey = "workflowExecutionID" - wnKey = "workflowName" - woIDKey = "workflowOwner" - sIDKey = "stepID" - sRKey = "stepRef" + capabilityIDKey = "capabilityID" + triggerIDKey = "triggerID" + workflowIDKey = "workflowID" + workflowExecutionIDKey = "workflowExecutionID" + workflowNameKey = "workflowName" + workflowOwnerKey = "workflowOwner" + stepIDKey = "stepID" + stepRefKey = "stepRef" ) -var orderedLabelKeys = []string{sRKey, sIDKey, tIDKey, cIDKey, eIDKey, wIDKey} +var orderedLabelKeys = []string{stepRefKey, stepIDKey, triggerIDKey, capabilityIDKey, workflowExecutionIDKey, workflowIDKey} From 935b71c72681f71e85496c5efd35b640dacdca7d Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 12:57:37 -0400 Subject: [PATCH 06/12] make `gomodtidy` --- core/scripts/go.mod | 4 ++-- core/scripts/go.sum | 8 ++++---- deployment/go.mod | 4 ++-- deployment/go.sum | 8 ++++---- go.mod | 2 +- go.sum | 12 ++---------- integration-tests/go.mod | 4 ++-- integration-tests/go.sum | 8 ++++---- integration-tests/load/go.mod | 4 ++-- integration-tests/load/go.sum | 8 ++++---- 10 files changed, 27 insertions(+), 35 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index d5100c6f3d2..dfd6573976d 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 @@ -288,7 +288,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.27 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 005d95779ae..3ff51f156b9 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1090,10 +1090,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1:+VR9yKhbz+iCtWnCabaCDP18lIqGnk7YvGQIbJYgDrs= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/deployment/go.mod b/deployment/go.mod index 14630351641..fe9631f9ecf 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -23,8 +23,8 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/deployment/go.sum b/deployment/go.sum index 5c4f0df9cad..74770cacfe8 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,10 +1382,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1:+VR9yKhbz+iCtWnCabaCDP18lIqGnk7YvGQIbJYgDrs= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/go.mod b/go.mod index b72750556bb..96debc471a8 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 2557fcf80e6..84b91cb0a59 100644 --- a/go.sum +++ b/go.sum @@ -1075,16 +1075,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1:+VR9yKhbz+iCtWnCabaCDP18lIqGnk7YvGQIbJYgDrs= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac8 h1:201Qzwo1CdzrP5z4fiyUPeXGhtmzojmFRw/WWaI5TLc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105151155-7fba27d48ac8/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb h1:7aIxwoLaTqMhBluqqhnCxRlrfBWvsOk+oNAWzY7ESxk= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105152536-46c3902b0bcb/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175 h1:hFxTPuxQUeH8WhTMxVWqec1YJew4yoU9scnI6EaU1tA= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105155319-68d2832f0175/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 054fbb27787..c4dd4652904 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -35,8 +35,8 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index d4f87ad83e7..13ab1a370aa 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,10 +1403,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1:+VR9yKhbz+iCtWnCabaCDP18lIqGnk7YvGQIbJYgDrs= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index de72bc705e7..a1c2ea3f5bc 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -17,7 +17,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 @@ -64,7 +64,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 13e1974b17e..07153301a5a 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,10 +1392,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4 h1:+VR9yKhbz+iCtWnCabaCDP18lIqGnk7YvGQIbJYgDrs= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241101132401-00090bf7feb4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7 h1:AGi0kAtMRW1zl1h7sGw+3CKO4Nlev6iA08YfEcgJCGs= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241101093830-33711d0c3de7/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From de979421f3e43884ae8b7e467696b75a875fdefb Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 13:24:44 -0400 Subject: [PATCH 07/12] Repurposes monitoring keys --- core/capabilities/compute/compute.go | 9 +-- core/capabilities/compute/monitoring.go | 9 +-- core/platform/monitoring.go | 15 +++++ core/services/workflows/engine.go | 75 +++++++++++++------------ core/services/workflows/monitoring.go | 14 ----- 5 files changed, 59 insertions(+), 63 deletions(-) create mode 100644 core/platform/monitoring.go diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 82d58f0525e..94210712098 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -25,6 +25,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/validation" "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi" + "github.com/smartcontractkit/chainlink/v2/core/platform" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" ) @@ -213,10 +214,10 @@ func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchReq } cma := c.emitter.With( - workflowIDKey, req.Metadata.WorkflowId, - workflowNameKey, req.Metadata.WorkflowName, - workflowOwnerKey, req.Metadata.WorkflowOwner, - workflowExecutionIDKey, req.Metadata.WorkflowExecutionId, + platform.WorkflowIDKey, req.Metadata.WorkflowId, + platform.WorkflowNameKey, req.Metadata.WorkflowName, + platform.WorkflowOwnerKey, req.Metadata.WorkflowOwner, + platform.WorkflowExecutionIDKey, req.Metadata.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), ) diff --git a/core/capabilities/compute/monitoring.go b/core/capabilities/compute/monitoring.go index d81cabc9873..4b676c25f7d 100644 --- a/core/capabilities/compute/monitoring.go +++ b/core/capabilities/compute/monitoring.go @@ -1,10 +1,3 @@ package compute -// Observability keys -const ( - workflowIDKey = "workflowID" - workflowExecutionIDKey = "workflowExecutionID" - workflowNameKey = "workflowName" - workflowOwnerKey = "workflowOwner" - timestampKey = "computeTimestamp" -) +const timestampKey = "computeTimestamp" diff --git a/core/platform/monitoring.go b/core/platform/monitoring.go new file mode 100644 index 00000000000..056651ee440 --- /dev/null +++ b/core/platform/monitoring.go @@ -0,0 +1,15 @@ +package platform + +// Observability keys +const ( + CapabilityIDKey = "capabilityID" + TriggerIDKey = "triggerID" + WorkflowIDKey = "workflowID" + WorkflowExecutionIDKey = "workflowExecutionID" + WorkflowNameKey = "workflowName" + WorkflowOwnerKey = "workflowOwner" + StepIDKey = "stepID" + StepRefKey = "stepRef" +) + +var OrderedLabelKeys = []string{StepRefKey, StepIDKey, TriggerIDKey, CapabilityIDKey, WorkflowExecutionIDKey, WorkflowIDKey} diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index e9148773fb7..770576bb5eb 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -23,6 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/transmission" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/platform" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" ) @@ -167,9 +168,9 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { for _, t := range e.workflow.triggers { tg, err := e.registry.GetTrigger(ctx, t.ID) if err != nil { - log := e.logger.With(capabilityIDKey, t.ID) + log := e.logger.With(platform.CapabilityIDKey, t.ID) log.Errorf("failed to get trigger capability: %s", err) - logCustMsg(ctx, e.cma.With(capabilityIDKey, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) + logCustMsg(ctx, e.cma.With(platform.CapabilityIDKey, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) // we don't immediately return here, since we want to retry all triggers // to notify the user of all errors at once. triggersInitialized = false @@ -179,7 +180,7 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { } if !triggersInitialized { return &workflowError{reason: "failed to resolve triggers", labels: map[string]string{ - workflowIDKey: e.workflow.id, + platform.WorkflowIDKey: e.workflow.id, }} } @@ -201,15 +202,15 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { if err != nil { logCustMsg( ctx, - e.cma.With(workflowIDKey, e.workflow.id, stepIDKey, s.ID, stepRefKey, s.Ref), + e.cma.With(platform.WorkflowIDKey, e.workflow.id, platform.StepIDKey, s.ID, platform.StepRefKey, s.Ref), fmt.Sprintf("failed to initialize capability for step: %s", err), e.logger, ) return &workflowError{err: err, reason: "failed to initialize capability for step", labels: map[string]string{ - workflowIDKey: e.workflow.id, - stepIDKey: s.ID, - stepRefKey: s.Ref, + platform.WorkflowIDKey: e.workflow.id, + platform.StepIDKey: s.ID, + platform.StepRefKey: s.Ref, }} } @@ -231,8 +232,8 @@ func (e *Engine) initializeCapability(ctx context.Context, step *step) error { } return &workflowError{reason: reason, err: err, labels: map[string]string{ - workflowIDKey: e.workflow.id, - stepIDKey: step.ID, + platform.WorkflowIDKey: e.workflow.id, + platform.StepIDKey: step.ID, }} } @@ -318,7 +319,7 @@ func (e *Engine) init(ctx context.Context) { if err != nil { return &workflowError{err: err, reason: "failed to resolve workflow capabilities", labels: map[string]string{ - workflowIDKey: e.workflow.id, + platform.WorkflowIDKey: e.workflow.id, }} } return nil @@ -341,9 +342,9 @@ func (e *Engine) init(ctx context.Context) { for idx, t := range e.workflow.triggers { terr := e.registerTrigger(ctx, t, idx) if terr != nil { - log := e.logger.With(capabilityIDKey, t.ID) + log := e.logger.With(platform.CapabilityIDKey, t.ID) log.Errorf("failed to register trigger: %s", terr) - logCustMsg(ctx, e.cma.With(capabilityIDKey, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) + logCustMsg(ctx, e.cma.With(platform.CapabilityIDKey, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) } } @@ -451,9 +452,9 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // and triggerID might be "wf_123_trigger_0" return &workflowError{err: err, reason: fmt.Sprintf("failed to register trigger: %+v", triggerRegRequest), labels: map[string]string{ - workflowIDKey: e.workflow.id, - capabilityIDKey: t.ID, - triggerIDKey: triggerID, + platform.WorkflowIDKey: e.workflow.id, + platform.CapabilityIDKey: t.ID, + platform.TriggerIDKey: triggerID, }} } @@ -491,7 +492,7 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // `executionState`. func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpdateCh chan store.WorkflowExecutionStep, workflowCreatedAt *time.Time) { defer e.wg.Done() - lggr := e.logger.With(workflowExecutionIDKey, executionID) + lggr := e.logger.With(platform.WorkflowExecutionIDKey, executionID) e.logger.Debugf("running stepUpdateLoop for execution %s", executionID) for { select { @@ -505,11 +506,11 @@ func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpd } // Executed synchronously to ensure we correctly schedule subsequent tasks. e.logger.Debugw(fmt.Sprintf("received step update for execution %s", stepUpdate.ExecutionID), - workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) + platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) err := e.handleStepUpdate(ctx, stepUpdate, workflowCreatedAt) if err != nil { e.logger.Errorf(fmt.Sprintf("failed to update step state: %+v, %s", stepUpdate, err), - workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) + platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) } } } @@ -532,7 +533,7 @@ func generateExecutionID(workflowID, eventID string) (string, error) { // startExecution kicks off a new workflow execution when a trigger event is received. func (e *Engine) startExecution(ctx context.Context, executionID string, event *values.Map) error { - lggr := e.logger.With("event", event, workflowExecutionIDKey, executionID) + lggr := e.logger.With("event", event, platform.WorkflowExecutionIDKey, executionID) lggr.Debug("executing on a trigger event") ec := &store.WorkflowExecution{ Steps: map[string]*store.WorkflowExecutionStep{ @@ -584,8 +585,8 @@ func (e *Engine) startExecution(ctx context.Context, executionID string, event * } func (e *Engine) handleStepUpdate(ctx context.Context, stepUpdate store.WorkflowExecutionStep, workflowCreatedAt *time.Time) error { - l := e.logger.With(workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) - cma := e.cma.With(workflowExecutionIDKey, stepUpdate.ExecutionID, stepRefKey, stepUpdate.Ref) + l := e.logger.With(platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) + cma := e.cma.With(platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) // If we've been executing for too long, let's time the workflow step out and continue. if workflowCreatedAt != nil && e.clock.Since(*workflowCreatedAt) > e.maxExecutionDuration { @@ -658,7 +659,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { // If all dependencies are completed, enqueue the step. if !waitingOnDependencies { - e.logger.With(stepRefKey, step.Ref, workflowExecutionIDKey, state.ExecutionID, "state", copyState(state)). + e.logger.With(platform.StepRefKey, step.Ref, platform.WorkflowExecutionIDKey, state.ExecutionID, "state", copyState(state)). Debug("step request enqueued") e.pendingStepRequests <- stepRequest{ state: copyState(state), @@ -668,7 +669,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { } func (e *Engine) finishExecution(ctx context.Context, executionID string, status string) error { - e.logger.With(workflowExecutionIDKey, executionID, "status", status).Info("finishing execution") + e.logger.With(platform.WorkflowExecutionIDKey, executionID, "status", status).Info("finishing execution") metrics := e.metrics.with("status", status) err := e.executionStates.UpdateStatus(ctx, executionID, status) if err != nil { @@ -713,23 +714,23 @@ func (e *Engine) worker(ctx context.Context) { te := resp.Event if te.ID == "" { - e.logger.With(triggerIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") + e.logger.With(platform.TriggerIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") continue } executionID, err := generateExecutionID(e.workflow.id, te.ID) if err != nil { - e.logger.With(triggerIDKey, te.ID).Errorf("could not generate execution ID: %v", err) + e.logger.With(platform.TriggerIDKey, te.ID).Errorf("could not generate execution ID: %v", err) continue } - cma := e.cma.With(workflowExecutionIDKey, executionID) + cma := e.cma.With(platform.WorkflowExecutionIDKey, executionID) err = e.startExecution(ctx, executionID, resp.Event.Outputs) if err != nil { - e.logger.With(workflowExecutionIDKey, executionID).Errorf("failed to start execution: %v", err) + e.logger.With(platform.WorkflowExecutionIDKey, executionID).Errorf("failed to start execution: %v", err) logCustMsg(ctx, cma, fmt.Sprintf("failed to start execution: %s", err), e.logger) } else { - e.logger.With(workflowExecutionIDKey, executionID).Debug("execution started") + e.logger.With(platform.WorkflowExecutionIDKey, executionID).Debug("execution started") logCustMsg(ctx, cma, "execution started", e.logger) } case <-ctx.Done(): @@ -741,8 +742,8 @@ func (e *Engine) worker(ctx context.Context) { func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) { // Instantiate a child logger; in addition to the WorkflowID field the workflow // logger will already have, this adds the `stepRef` and `executionID` - l := e.logger.With(stepRefKey, msg.stepRef, workflowExecutionIDKey, msg.state.ExecutionID) - cma := e.cma.With(stepRefKey, msg.stepRef, workflowExecutionIDKey, msg.state.ExecutionID) + l := e.logger.With(platform.StepRefKey, msg.stepRef, platform.WorkflowExecutionIDKey, msg.state.ExecutionID) + cma := e.cma.With(platform.StepRefKey, msg.stepRef, platform.WorkflowExecutionIDKey, msg.state.ExecutionID) l.Debug("executing on a step event") stepState := &store.WorkflowExecutionStep{ @@ -1104,9 +1105,9 @@ func (e *Engine) Close() error { return &workflowError{err: innerErr, reason: fmt.Sprintf("failed to unregister capability from workflow: %+v", reg), labels: map[string]string{ - workflowIDKey: e.workflow.id, - stepIDKey: s.ID, - stepRefKey: s.Ref, + platform.WorkflowIDKey: e.workflow.id, + platform.StepIDKey: s.ID, + platform.StepRefKey: s.Ref, }} } @@ -1157,7 +1158,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { if cfg.Store == nil { return nil, &workflowError{reason: "store is nil", labels: map[string]string{ - workflowIDKey: cfg.WorkflowID, + platform.WorkflowIDKey: cfg.WorkflowID, }, } } @@ -1206,7 +1207,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { // - that the resulting graph is strongly connected (i.e. no disjointed subgraphs exist) // - etc. - cma := custmsg.NewLabeler().With(workflowIDKey, cfg.WorkflowID, workflowOwnerKey, cfg.WorkflowOwner, workflowNameKey, cfg.WorkflowName) + cma := custmsg.NewLabeler().With(platform.WorkflowIDKey, cfg.WorkflowID, platform.WorkflowOwnerKey, cfg.WorkflowOwner, platform.WorkflowNameKey, cfg.WorkflowName) workflow, err := Parse(cfg.Workflow) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to parse workflow: %s", err), cfg.Lggr) @@ -1220,7 +1221,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { engine = &Engine{ cma: cma, logger: cfg.Lggr.Named("WorkflowEngine").With("workflowID", cfg.WorkflowID), - metrics: workflowsMetricLabeler{metrics.NewLabeler().With(workflowIDKey, cfg.WorkflowID, workflowOwnerKey, cfg.WorkflowOwner, workflowNameKey, workflow.name)}, + metrics: workflowsMetricLabeler{metrics.NewLabeler().With(platform.WorkflowIDKey, cfg.WorkflowID, platform.WorkflowOwnerKey, cfg.WorkflowOwner, platform.WorkflowNameKey, workflow.name)}, registry: cfg.Registry, workflow: workflow, secretsFetcher: cfg.SecretsFetcher, @@ -1268,7 +1269,7 @@ func (e *workflowError) Error() string { } // prefix the error with the labels - for _, label := range orderedLabelKeys { + for _, label := range platform.OrderedLabelKeys { // This will silently ignore any labels that are not present in the map // are we ok with this? if value, ok := e.labels[label]; ok { diff --git a/core/services/workflows/monitoring.go b/core/services/workflows/monitoring.go index 2389677036d..d498ff354c9 100644 --- a/core/services/workflows/monitoring.go +++ b/core/services/workflows/monitoring.go @@ -92,17 +92,3 @@ func (c workflowsMetricLabeler) incrementEngineHeartbeatCounter(ctx context.Cont otelLabels := localMonitoring.KvMapToOtelAttributes(c.Labels) engineHeartbeatCounter.Add(ctx, 1, metric.WithAttributes(otelLabels...)) } - -// Observability keys -const ( - capabilityIDKey = "capabilityID" - triggerIDKey = "triggerID" - workflowIDKey = "workflowID" - workflowExecutionIDKey = "workflowExecutionID" - workflowNameKey = "workflowName" - workflowOwnerKey = "workflowOwner" - stepIDKey = "stepID" - stepRefKey = "stepRef" -) - -var orderedLabelKeys = []string{stepRefKey, stepIDKey, triggerIDKey, capabilityIDKey, workflowExecutionIDKey, workflowIDKey} From 0ed9331815803aa8269770646d3fd66cb2ef524e Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Tue, 5 Nov 2024 13:31:06 -0400 Subject: [PATCH 08/12] Fixes CI --- core/services/workflows/delegate.go | 3 ++- core/services/workflows/engine_test.go | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/services/workflows/delegate.go b/core/services/workflows/delegate.go index cd8a37764a0..2ea73dbe62f 100644 --- a/core/services/workflows/delegate.go +++ b/core/services/workflows/delegate.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink/v2/core/logger" + "github.com/smartcontractkit/chainlink/v2/core/platform" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" ) @@ -39,7 +40,7 @@ func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error) { - cma := custmsg.NewLabeler().With(workflowIDKey, spec.WorkflowSpec.WorkflowID, workflowOwnerKey, spec.WorkflowSpec.WorkflowOwner, workflowNameKey, spec.WorkflowSpec.WorkflowName) + cma := custmsg.NewLabeler().With(platform.WorkflowIDKey, spec.WorkflowSpec.WorkflowID, platform.WorkflowOwnerKey, spec.WorkflowSpec.WorkflowOwner, platform.WorkflowNameKey, spec.WorkflowSpec.WorkflowName) sdkSpec, err := spec.WorkflowSpec.SDKSpec(ctx) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to start workflow engine: failed to get workflow sdk spec: %v", err), d.logger) diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 15dc7f488e9..9c89afe6ee4 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -22,6 +22,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" "github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi" + "github.com/smartcontractkit/chainlink/v2/core/platform" gcmocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector/mocks" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" @@ -974,26 +975,26 @@ func TestEngine_Error(t *testing.T) { }{ { name: "Error with error and reason", - labels: map[string]string{workflowIDKey: "my-workflow-id"}, + labels: map[string]string{platform.WorkflowIDKey: "my-workflow-id"}, err: err, reason: "some reason", want: "workflowID my-workflow-id: some reason: some error", }, { name: "Error with error and no reason", - labels: map[string]string{workflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, + labels: map[string]string{platform.WorkflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, err: err, want: "workflowExecutionID dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751: some error", }, { name: "Error with no error and reason", - labels: map[string]string{capabilityIDKey: "streams-trigger:network_eth@1.0.0"}, + labels: map[string]string{platform.CapabilityIDKey: "streams-trigger:network_eth@1.0.0"}, reason: "some reason", want: "capabilityID streams-trigger:network_eth@1.0.0: some reason", }, { name: "Error with no error and no reason", - labels: map[string]string{triggerIDKey: "wf_123_trigger_456"}, + labels: map[string]string{platform.TriggerIDKey: "wf_123_trigger_456"}, want: "triggerID wf_123_trigger_456: ", }, { @@ -1006,9 +1007,9 @@ func TestEngine_Error(t *testing.T) { { name: "Multiple labels", labels: map[string]string{ - workflowIDKey: "my-workflow-id", - workflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", - capabilityIDKey: "streams-trigger:network_eth@1.0.0", + platform.WorkflowIDKey: "my-workflow-id", + platform.WorkflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", + platform.CapabilityIDKey: "streams-trigger:network_eth@1.0.0", }, err: err, reason: "some reason", From f589d49fb69ed9b700a8e06e6e0de14e8328d269 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Wed, 6 Nov 2024 14:32:51 -0400 Subject: [PATCH 09/12] Bumps CCIP --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index dfd6573976d..b64ddeeeb18 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -288,7 +288,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.27 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 3ff51f156b9..417cf348dc3 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1090,8 +1090,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/deployment/go.mod b/deployment/go.mod index fe9631f9ecf..558b0cc1bc5 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -23,7 +23,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/deployment/go.sum b/deployment/go.sum index 74770cacfe8..f140846f9c1 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,8 +1382,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/go.mod b/go.mod index 96debc471a8..78005e6b42d 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e diff --git a/go.sum b/go.sum index 84b91cb0a59..0855a6d92e4 100644 --- a/go.sum +++ b/go.sum @@ -1075,8 +1075,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index c4dd4652904..ef8a0ee8ce0 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -35,7 +35,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 13ab1a370aa..cfede95e41f 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,8 +1403,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index a1c2ea3f5bc..feb97b0e8df 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -64,7 +64,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 07153301a5a..f8403cc4bc2 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,8 +1392,8 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1:GWjim4uGGFbye4XbJP0cPAbARhc8u3cAJU8jLYy0mXM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= From 2157668874999782fe3078e4bc6e34d2673771dd Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Thu, 7 Nov 2024 10:12:42 -0400 Subject: [PATCH 10/12] Bumps common --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 4d293a81c04..5e71ab7619d 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -24,7 +24,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index ed6e2451226..3160b2c6c6c 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1092,8 +1092,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae h1:uqce0bjNVYzFrrVLafXgyn8SVNdfOtZekLfAwQihHiA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/deployment/go.mod b/deployment/go.mod index f0587cdcd4d..e88dd743849 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -24,7 +24,7 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/deployment/go.sum b/deployment/go.sum index 2047bc591de..07d83f9a968 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1384,8 +1384,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae h1:uqce0bjNVYzFrrVLafXgyn8SVNdfOtZekLfAwQihHiA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/go.mod b/go.mod index 18a1aa3dda4..c18a53ecdd4 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 diff --git a/go.sum b/go.sum index af47e59774f..e0adc852492 100644 --- a/go.sum +++ b/go.sum @@ -1077,8 +1077,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae h1:uqce0bjNVYzFrrVLafXgyn8SVNdfOtZekLfAwQihHiA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 03c04bae6f3..e021543206c 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,7 +36,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 5edbe01264e..144d29156e5 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1405,8 +1405,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae h1:uqce0bjNVYzFrrVLafXgyn8SVNdfOtZekLfAwQihHiA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7204ed1ad9f..24cb2cb2a4f 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -17,7 +17,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 9e06498496a..9ad23c4de4c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422 h1:VfH/AW5NtTmroY9zz6OYCPFbFTqpMyJ2ubgT9ahYf3U= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241106140121-4c9ee21ab422/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a h1:cmE2fzK1hsRArr5s4Ygao7bBdSgfLJRHIGFMYxBlEhc= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241105163318-e1b7c81d582a/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae h1:uqce0bjNVYzFrrVLafXgyn8SVNdfOtZekLfAwQihHiA= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142051-c7bded1c08ae/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= From 362ead7b1b9a75bae61a10f208ea8e5afd6accfb Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Thu, 7 Nov 2024 11:38:49 -0400 Subject: [PATCH 11/12] Address review comments --- core/capabilities/compute/compute.go | 8 +-- core/platform/monitoring.go | 25 +++++---- core/services/workflows/delegate.go | 2 +- core/services/workflows/engine.go | 74 +++++++++++++------------- core/services/workflows/engine_test.go | 14 ++--- 5 files changed, 65 insertions(+), 58 deletions(-) diff --git a/core/capabilities/compute/compute.go b/core/capabilities/compute/compute.go index 94210712098..7e6961d2e8a 100644 --- a/core/capabilities/compute/compute.go +++ b/core/capabilities/compute/compute.go @@ -214,10 +214,10 @@ func (c *Compute) createFetcher() func(ctx context.Context, req *wasmpb.FetchReq } cma := c.emitter.With( - platform.WorkflowIDKey, req.Metadata.WorkflowId, - platform.WorkflowNameKey, req.Metadata.WorkflowName, - platform.WorkflowOwnerKey, req.Metadata.WorkflowOwner, - platform.WorkflowExecutionIDKey, req.Metadata.WorkflowExecutionId, + platform.KeyWorkflowID, req.Metadata.WorkflowId, + platform.KeyWorkflowName, req.Metadata.WorkflowName, + platform.KeyWorkflowOwner, req.Metadata.WorkflowOwner, + platform.KeyWorkflowExecutionID, req.Metadata.WorkflowExecutionId, timestampKey, time.Now().UTC().Format(time.RFC3339Nano), ) diff --git a/core/platform/monitoring.go b/core/platform/monitoring.go index 056651ee440..190a0f6e015 100644 --- a/core/platform/monitoring.go +++ b/core/platform/monitoring.go @@ -1,15 +1,22 @@ package platform +import ( + "iter" + "slices" +) + // Observability keys const ( - CapabilityIDKey = "capabilityID" - TriggerIDKey = "triggerID" - WorkflowIDKey = "workflowID" - WorkflowExecutionIDKey = "workflowExecutionID" - WorkflowNameKey = "workflowName" - WorkflowOwnerKey = "workflowOwner" - StepIDKey = "stepID" - StepRefKey = "stepRef" + KeyCapabilityID = "capabilityID" + KeyTriggerID = "triggerID" + KeyWorkflowID = "workflowID" + KeyWorkflowExecutionID = "workflowExecutionID" + KeyWorkflowName = "workflowName" + KeyWorkflowOwner = "workflowOwner" + KeyStepID = "stepID" + KeyStepRef = "stepRef" ) -var OrderedLabelKeys = []string{StepRefKey, StepIDKey, TriggerIDKey, CapabilityIDKey, WorkflowExecutionIDKey, WorkflowIDKey} +func KeysSorted() iter.Seq[string] { + return slices.Values([]string{KeyStepRef, KeyStepID, KeyTriggerID, KeyCapabilityID, KeyWorkflowExecutionID, KeyWorkflowID}) +} diff --git a/core/services/workflows/delegate.go b/core/services/workflows/delegate.go index 2ea73dbe62f..72aff3033d0 100644 --- a/core/services/workflows/delegate.go +++ b/core/services/workflows/delegate.go @@ -40,7 +40,7 @@ func (d *Delegate) OnDeleteJob(context.Context, job.Job) error { return nil } // ServicesForSpec satisfies the job.Delegate interface. func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error) { - cma := custmsg.NewLabeler().With(platform.WorkflowIDKey, spec.WorkflowSpec.WorkflowID, platform.WorkflowOwnerKey, spec.WorkflowSpec.WorkflowOwner, platform.WorkflowNameKey, spec.WorkflowSpec.WorkflowName) + cma := custmsg.NewLabeler().With(platform.KeyWorkflowID, spec.WorkflowSpec.WorkflowID, platform.KeyWorkflowOwner, spec.WorkflowSpec.WorkflowOwner, platform.KeyWorkflowName, spec.WorkflowSpec.WorkflowName) sdkSpec, err := spec.WorkflowSpec.SDKSpec(ctx) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to start workflow engine: failed to get workflow sdk spec: %v", err), d.logger) diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index 770576bb5eb..c7e673348d0 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -168,9 +168,9 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { for _, t := range e.workflow.triggers { tg, err := e.registry.GetTrigger(ctx, t.ID) if err != nil { - log := e.logger.With(platform.CapabilityIDKey, t.ID) + log := e.logger.With(platform.KeyCapabilityID, t.ID) log.Errorf("failed to get trigger capability: %s", err) - logCustMsg(ctx, e.cma.With(platform.CapabilityIDKey, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) + logCustMsg(ctx, e.cma.With(platform.KeyCapabilityID, t.ID), fmt.Sprintf("failed to resolve trigger: %s", err), log) // we don't immediately return here, since we want to retry all triggers // to notify the user of all errors at once. triggersInitialized = false @@ -180,7 +180,7 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { } if !triggersInitialized { return &workflowError{reason: "failed to resolve triggers", labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, + platform.KeyWorkflowID: e.workflow.id, }} } @@ -202,15 +202,15 @@ func (e *Engine) resolveWorkflowCapabilities(ctx context.Context) error { if err != nil { logCustMsg( ctx, - e.cma.With(platform.WorkflowIDKey, e.workflow.id, platform.StepIDKey, s.ID, platform.StepRefKey, s.Ref), + e.cma.With(platform.KeyWorkflowID, e.workflow.id, platform.KeyStepID, s.ID, platform.KeyStepRef, s.Ref), fmt.Sprintf("failed to initialize capability for step: %s", err), e.logger, ) return &workflowError{err: err, reason: "failed to initialize capability for step", labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, - platform.StepIDKey: s.ID, - platform.StepRefKey: s.Ref, + platform.KeyWorkflowID: e.workflow.id, + platform.KeyStepID: s.ID, + platform.KeyStepRef: s.Ref, }} } @@ -232,8 +232,8 @@ func (e *Engine) initializeCapability(ctx context.Context, step *step) error { } return &workflowError{reason: reason, err: err, labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, - platform.StepIDKey: step.ID, + platform.KeyWorkflowID: e.workflow.id, + platform.KeyStepID: step.ID, }} } @@ -319,7 +319,7 @@ func (e *Engine) init(ctx context.Context) { if err != nil { return &workflowError{err: err, reason: "failed to resolve workflow capabilities", labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, + platform.KeyWorkflowID: e.workflow.id, }} } return nil @@ -342,9 +342,9 @@ func (e *Engine) init(ctx context.Context) { for idx, t := range e.workflow.triggers { terr := e.registerTrigger(ctx, t, idx) if terr != nil { - log := e.logger.With(platform.CapabilityIDKey, t.ID) + log := e.logger.With(platform.KeyCapabilityID, t.ID) log.Errorf("failed to register trigger: %s", terr) - logCustMsg(ctx, e.cma.With(platform.CapabilityIDKey, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) + logCustMsg(ctx, e.cma.With(platform.KeyCapabilityID, t.ID), fmt.Sprintf("failed to register trigger: %s", terr), log) } } @@ -452,9 +452,9 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // and triggerID might be "wf_123_trigger_0" return &workflowError{err: err, reason: fmt.Sprintf("failed to register trigger: %+v", triggerRegRequest), labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, - platform.CapabilityIDKey: t.ID, - platform.TriggerIDKey: triggerID, + platform.KeyWorkflowID: e.workflow.id, + platform.KeyCapabilityID: t.ID, + platform.KeyTriggerID: triggerID, }} } @@ -492,7 +492,7 @@ func (e *Engine) registerTrigger(ctx context.Context, t *triggerCapability, trig // `executionState`. func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpdateCh chan store.WorkflowExecutionStep, workflowCreatedAt *time.Time) { defer e.wg.Done() - lggr := e.logger.With(platform.WorkflowExecutionIDKey, executionID) + lggr := e.logger.With(platform.KeyWorkflowExecutionID, executionID) e.logger.Debugf("running stepUpdateLoop for execution %s", executionID) for { select { @@ -506,11 +506,11 @@ func (e *Engine) stepUpdateLoop(ctx context.Context, executionID string, stepUpd } // Executed synchronously to ensure we correctly schedule subsequent tasks. e.logger.Debugw(fmt.Sprintf("received step update for execution %s", stepUpdate.ExecutionID), - platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) + platform.KeyWorkflowExecutionID, stepUpdate.ExecutionID, platform.KeyStepRef, stepUpdate.Ref) err := e.handleStepUpdate(ctx, stepUpdate, workflowCreatedAt) if err != nil { e.logger.Errorf(fmt.Sprintf("failed to update step state: %+v, %s", stepUpdate, err), - platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) + platform.KeyWorkflowExecutionID, stepUpdate.ExecutionID, platform.KeyStepRef, stepUpdate.Ref) } } } @@ -533,7 +533,7 @@ func generateExecutionID(workflowID, eventID string) (string, error) { // startExecution kicks off a new workflow execution when a trigger event is received. func (e *Engine) startExecution(ctx context.Context, executionID string, event *values.Map) error { - lggr := e.logger.With("event", event, platform.WorkflowExecutionIDKey, executionID) + lggr := e.logger.With("event", event, platform.KeyWorkflowExecutionID, executionID) lggr.Debug("executing on a trigger event") ec := &store.WorkflowExecution{ Steps: map[string]*store.WorkflowExecutionStep{ @@ -585,8 +585,8 @@ func (e *Engine) startExecution(ctx context.Context, executionID string, event * } func (e *Engine) handleStepUpdate(ctx context.Context, stepUpdate store.WorkflowExecutionStep, workflowCreatedAt *time.Time) error { - l := e.logger.With(platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) - cma := e.cma.With(platform.WorkflowExecutionIDKey, stepUpdate.ExecutionID, platform.StepRefKey, stepUpdate.Ref) + l := e.logger.With(platform.KeyWorkflowExecutionID, stepUpdate.ExecutionID, platform.KeyStepRef, stepUpdate.Ref) + cma := e.cma.With(platform.KeyWorkflowExecutionID, stepUpdate.ExecutionID, platform.KeyStepRef, stepUpdate.Ref) // If we've been executing for too long, let's time the workflow step out and continue. if workflowCreatedAt != nil && e.clock.Since(*workflowCreatedAt) > e.maxExecutionDuration { @@ -659,7 +659,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { // If all dependencies are completed, enqueue the step. if !waitingOnDependencies { - e.logger.With(platform.StepRefKey, step.Ref, platform.WorkflowExecutionIDKey, state.ExecutionID, "state", copyState(state)). + e.logger.With(platform.KeyStepRef, step.Ref, platform.KeyWorkflowExecutionID, state.ExecutionID, "state", copyState(state)). Debug("step request enqueued") e.pendingStepRequests <- stepRequest{ state: copyState(state), @@ -669,7 +669,7 @@ func (e *Engine) queueIfReady(state store.WorkflowExecution, step *step) { } func (e *Engine) finishExecution(ctx context.Context, executionID string, status string) error { - e.logger.With(platform.WorkflowExecutionIDKey, executionID, "status", status).Info("finishing execution") + e.logger.With(platform.KeyWorkflowExecutionID, executionID, "status", status).Info("finishing execution") metrics := e.metrics.with("status", status) err := e.executionStates.UpdateStatus(ctx, executionID, status) if err != nil { @@ -714,23 +714,23 @@ func (e *Engine) worker(ctx context.Context) { te := resp.Event if te.ID == "" { - e.logger.With(platform.TriggerIDKey, te.TriggerType).Error("trigger event ID is empty; not executing") + e.logger.With(platform.KeyTriggerID, te.TriggerType).Error("trigger event ID is empty; not executing") continue } executionID, err := generateExecutionID(e.workflow.id, te.ID) if err != nil { - e.logger.With(platform.TriggerIDKey, te.ID).Errorf("could not generate execution ID: %v", err) + e.logger.With(platform.KeyTriggerID, te.ID).Errorf("could not generate execution ID: %v", err) continue } - cma := e.cma.With(platform.WorkflowExecutionIDKey, executionID) + cma := e.cma.With(platform.KeyWorkflowExecutionID, executionID) err = e.startExecution(ctx, executionID, resp.Event.Outputs) if err != nil { - e.logger.With(platform.WorkflowExecutionIDKey, executionID).Errorf("failed to start execution: %v", err) + e.logger.With(platform.KeyWorkflowExecutionID, executionID).Errorf("failed to start execution: %v", err) logCustMsg(ctx, cma, fmt.Sprintf("failed to start execution: %s", err), e.logger) } else { - e.logger.With(platform.WorkflowExecutionIDKey, executionID).Debug("execution started") + e.logger.With(platform.KeyWorkflowExecutionID, executionID).Debug("execution started") logCustMsg(ctx, cma, "execution started", e.logger) } case <-ctx.Done(): @@ -742,8 +742,8 @@ func (e *Engine) worker(ctx context.Context) { func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) { // Instantiate a child logger; in addition to the WorkflowID field the workflow // logger will already have, this adds the `stepRef` and `executionID` - l := e.logger.With(platform.StepRefKey, msg.stepRef, platform.WorkflowExecutionIDKey, msg.state.ExecutionID) - cma := e.cma.With(platform.StepRefKey, msg.stepRef, platform.WorkflowExecutionIDKey, msg.state.ExecutionID) + l := e.logger.With(platform.KeyStepRef, msg.stepRef, platform.KeyWorkflowExecutionID, msg.state.ExecutionID) + cma := e.cma.With(platform.KeyStepRef, msg.stepRef, platform.KeyWorkflowExecutionID, msg.state.ExecutionID) l.Debug("executing on a step event") stepState := &store.WorkflowExecutionStep{ @@ -1105,9 +1105,9 @@ func (e *Engine) Close() error { return &workflowError{err: innerErr, reason: fmt.Sprintf("failed to unregister capability from workflow: %+v", reg), labels: map[string]string{ - platform.WorkflowIDKey: e.workflow.id, - platform.StepIDKey: s.ID, - platform.StepRefKey: s.Ref, + platform.KeyWorkflowID: e.workflow.id, + platform.KeyStepID: s.ID, + platform.KeyStepRef: s.Ref, }} } @@ -1158,7 +1158,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { if cfg.Store == nil { return nil, &workflowError{reason: "store is nil", labels: map[string]string{ - platform.WorkflowIDKey: cfg.WorkflowID, + platform.KeyWorkflowID: cfg.WorkflowID, }, } } @@ -1207,7 +1207,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { // - that the resulting graph is strongly connected (i.e. no disjointed subgraphs exist) // - etc. - cma := custmsg.NewLabeler().With(platform.WorkflowIDKey, cfg.WorkflowID, platform.WorkflowOwnerKey, cfg.WorkflowOwner, platform.WorkflowNameKey, cfg.WorkflowName) + cma := custmsg.NewLabeler().With(platform.KeyWorkflowID, cfg.WorkflowID, platform.KeyWorkflowOwner, cfg.WorkflowOwner, platform.KeyWorkflowName, cfg.WorkflowName) workflow, err := Parse(cfg.Workflow) if err != nil { logCustMsg(ctx, cma, fmt.Sprintf("failed to parse workflow: %s", err), cfg.Lggr) @@ -1221,7 +1221,7 @@ func NewEngine(ctx context.Context, cfg Config) (engine *Engine, err error) { engine = &Engine{ cma: cma, logger: cfg.Lggr.Named("WorkflowEngine").With("workflowID", cfg.WorkflowID), - metrics: workflowsMetricLabeler{metrics.NewLabeler().With(platform.WorkflowIDKey, cfg.WorkflowID, platform.WorkflowOwnerKey, cfg.WorkflowOwner, platform.WorkflowNameKey, workflow.name)}, + metrics: workflowsMetricLabeler{metrics.NewLabeler().With(platform.KeyWorkflowID, cfg.WorkflowID, platform.KeyWorkflowOwner, cfg.WorkflowOwner, platform.KeyWorkflowName, workflow.name)}, registry: cfg.Registry, workflow: workflow, secretsFetcher: cfg.SecretsFetcher, @@ -1269,7 +1269,7 @@ func (e *workflowError) Error() string { } // prefix the error with the labels - for _, label := range platform.OrderedLabelKeys { + for label := range platform.KeysSorted() { // This will silently ignore any labels that are not present in the map // are we ok with this? if value, ok := e.labels[label]; ok { diff --git a/core/services/workflows/engine_test.go b/core/services/workflows/engine_test.go index 9c89afe6ee4..e283a2b700c 100644 --- a/core/services/workflows/engine_test.go +++ b/core/services/workflows/engine_test.go @@ -975,26 +975,26 @@ func TestEngine_Error(t *testing.T) { }{ { name: "Error with error and reason", - labels: map[string]string{platform.WorkflowIDKey: "my-workflow-id"}, + labels: map[string]string{platform.KeyWorkflowID: "my-workflow-id"}, err: err, reason: "some reason", want: "workflowID my-workflow-id: some reason: some error", }, { name: "Error with error and no reason", - labels: map[string]string{platform.WorkflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, + labels: map[string]string{platform.KeyWorkflowExecutionID: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751"}, err: err, want: "workflowExecutionID dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751: some error", }, { name: "Error with no error and reason", - labels: map[string]string{platform.CapabilityIDKey: "streams-trigger:network_eth@1.0.0"}, + labels: map[string]string{platform.KeyCapabilityID: "streams-trigger:network_eth@1.0.0"}, reason: "some reason", want: "capabilityID streams-trigger:network_eth@1.0.0: some reason", }, { name: "Error with no error and no reason", - labels: map[string]string{platform.TriggerIDKey: "wf_123_trigger_456"}, + labels: map[string]string{platform.KeyTriggerID: "wf_123_trigger_456"}, want: "triggerID wf_123_trigger_456: ", }, { @@ -1007,9 +1007,9 @@ func TestEngine_Error(t *testing.T) { { name: "Multiple labels", labels: map[string]string{ - platform.WorkflowIDKey: "my-workflow-id", - platform.WorkflowExecutionIDKey: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", - platform.CapabilityIDKey: "streams-trigger:network_eth@1.0.0", + platform.KeyWorkflowID: "my-workflow-id", + platform.KeyWorkflowExecutionID: "dd3708ac7d8dd6fa4fae0fb87b73f318a4da2526c123e159b72435e3b2fe8751", + platform.KeyCapabilityID: "streams-trigger:network_eth@1.0.0", }, err: err, reason: "some reason", From 24e58bb94f872c6c4ca95b794a681aed065bfa12 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Thu, 7 Nov 2024 11:50:59 -0400 Subject: [PATCH 12/12] Reverts unsupported approach --- core/platform/monitoring.go | 9 +-------- core/services/workflows/engine.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/platform/monitoring.go b/core/platform/monitoring.go index 190a0f6e015..30221db240c 100644 --- a/core/platform/monitoring.go +++ b/core/platform/monitoring.go @@ -1,10 +1,5 @@ package platform -import ( - "iter" - "slices" -) - // Observability keys const ( KeyCapabilityID = "capabilityID" @@ -17,6 +12,4 @@ const ( KeyStepRef = "stepRef" ) -func KeysSorted() iter.Seq[string] { - return slices.Values([]string{KeyStepRef, KeyStepID, KeyTriggerID, KeyCapabilityID, KeyWorkflowExecutionID, KeyWorkflowID}) -} +var OrderedLabelKeys = []string{KeyStepRef, KeyStepID, KeyTriggerID, KeyCapabilityID, KeyWorkflowExecutionID, KeyWorkflowID} diff --git a/core/services/workflows/engine.go b/core/services/workflows/engine.go index c7e673348d0..0d5bfefcbd3 100644 --- a/core/services/workflows/engine.go +++ b/core/services/workflows/engine.go @@ -1269,7 +1269,7 @@ func (e *workflowError) Error() string { } // prefix the error with the labels - for label := range platform.KeysSorted() { + for _, label := range platform.OrderedLabelKeys { // This will silently ignore any labels that are not present in the map // are we ok with this? if value, ok := e.labels[label]; ok {