Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KS-368] keystone/workflow engine logging #13563

Merged
merged 12 commits into from
Jun 26, 2024
5 changes: 5 additions & 0 deletions .changeset/popular-candles-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal Clean up workflow engine logging
8 changes: 5 additions & 3 deletions core/capabilities/transmission/local_target_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import (
type LocalTargetCapability struct {
lggr logger.Logger
capabilities.TargetCapability
localNode capabilities.Node
localNode capabilities.Node
capabilityID string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this so we can log the capability ID that is being wrapped. I didn't want to waste a grpc call on Info when we already have this information

}

func NewLocalTargetCapability(lggr logger.Logger, localDON capabilities.Node, underlying capabilities.TargetCapability) *LocalTargetCapability {
func NewLocalTargetCapability(lggr logger.Logger, capabilityID string, localDON capabilities.Node, underlying capabilities.TargetCapability) *LocalTargetCapability {
return &LocalTargetCapability{
TargetCapability: underlying,
capabilityID: capabilityID,
lggr: lggr,
localNode: localDON,
}
Expand All @@ -38,7 +40,7 @@ func (l *LocalTargetCapability) Execute(ctx context.Context, req capabilities.Ca

peerIDToTransmissionDelay, err := GetPeerIDToTransmissionDelay(l.localNode.WorkflowDON.Members, req)
if err != nil {
return nil, fmt.Errorf("failed to get peer ID to transmission delay map: %w", err)
return nil, fmt.Errorf("capability id: %s failed to get peer ID to transmission delay map: %w", l.capabilityID, err)
HenryNguyen5 marked this conversation as resolved.
Show resolved Hide resolved
}

delay, existsForPeerID := peerIDToTransmissionDelay[*l.localNode.PeerID]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestScheduledExecutionStrategy_LocalDON(t *testing.T) {
},
PeerID: &ids[tc.position],
}
localTargetCapability := NewLocalTargetCapability(log, localDON, mt)
localTargetCapability := NewLocalTargetCapability(log, "capabilityID", localDON, mt)

_, err = localTargetCapability.Execute(tests.Context(t), req)

Expand Down
2 changes: 1 addition & 1 deletion core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
jobORM = job.NewORM(opts.DS, pipelineORM, bridgeORM, keyStore, globalLogger)
txmORM = txmgr.NewTxStore(opts.DS, globalLogger)
streamRegistry = streams.NewRegistry(globalLogger, pipelineRunner)
workflowORM = workflowstore.NewDBStore(opts.DS, clockwork.NewRealClock())
workflowORM = workflowstore.NewDBStore(opts.DS, globalLogger, clockwork.NewRealClock())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a logger to our ORM, i found it pretty useful when debugging failing tests

)

for _, chain := range legacyEVMChains.Slice() {
Expand Down
Loading
Loading