Skip to content

OEV-779 Send custom event on atlas error#339

Merged
cll-gg merged 18 commits intodevelopfrom
OEV-779-add-metrics-to-ofa-traffic
Feb 3, 2026
Merged

OEV-779 Send custom event on atlas error#339
cll-gg merged 18 commits intodevelopfrom
OEV-779-add-metrics-to-ofa-traffic

Conversation

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

⚠️ API Diff Results - Breaking changes detected

📦 Module: github-com-smartcontractkit-chainlink-evm

🔴 Breaking Changes (1)

pkg/txm/clientwrappers/dualbroadcast (1)
  • NewMetaMetrics — Type changed:
func(
  - string
  + string, 
  + github.com/smartcontractkit/chainlink-common/pkg/logger.Logger
)
(*MetaMetrics, error)

📄 View full apidiff report

@cll-gg
Copy link
Contributor Author

cll-gg commented Jan 29, 2026

⚠️ API Diff Results - Breaking changes detected

📦 Module: github-com-smartcontractkit-chainlink-evm

🔴 Breaking Changes (1)

pkg/txm/clientwrappers/dualbroadcast (1)
  • NewMetaMetrics — Type changed:

func(

  • string
  • string,
  • github.com/smartcontractkit/chainlink-common/pkg/logger.Logger
    )
    (*MetaMetrics, error)
    📄 View full apidiff report

No problem, NewMetaMetrics is only used in chainlink-evm, see here

@cll-gg cll-gg changed the title First pass OEV-779 Send custom event on atlas error Jan 29, 2026
alejoberardino
alejoberardino previously approved these changes Jan 30, 2026
@cll-gg cll-gg marked this pull request as ready for review January 30, 2026 13:23
@cll-gg cll-gg requested review from a team and dimriou as code owners January 30, 2026 13:23
Copilot AI review requested due to automatic review settings January 30, 2026 13:23
@cll-gg cll-gg requested review from a team as code owners January 30, 2026 13:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds custom event emission for Atlas errors in the dual broadcast transaction manager. The changes enable tracking of FastLane Atlas errors through OpenTelemetry events sent to Beholder, providing better observability for Atlas-related failures.

Changes:

  • Added new emitAtlasError and emitAtlasErrorWithHttpStatusCode methods to emit structured error events
  • Updated MetaMetrics constructor to accept a logger parameter for logging error events
  • Integrated error event emission at transaction send request and operation failure points

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/txm/clientwrappers/dualbroadcast/meta_metrics.go Added error emission methods and logger to MetaMetrics struct
pkg/txm/clientwrappers/dualbroadcast/meta_metrics_test.go Added comprehensive tests for the new error emission functionality
pkg/txm/clientwrappers/dualbroadcast/meta_client.go Integrated error emission calls at failure points
go.mod Updated chainlink-protos dependency to include FastLaneAtlasError message
Makefile Added help text comments to existing targets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cll-gg
Copy link
Contributor Author

cll-gg commented Jan 30, 2026

CI failures are due to smartcontractkit/chainlink-protos#264 not being merged, will fix that when it's merged.

}

// emitAtlasErrorWithHttpStatusCode emits an OTel event with an HTTP status code to track FastLane Atlas errors
func (m *MetaMetrics) emitAtlasErrorWithHttpStatusCode(ctx context.Context, errType string, customURL *url.URL, cause error, httpStatusCode int, tx *types.Transaction) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the main code doesn't ever utilize the httpStatusCode param, is there a point for tests to test for it? I feel we can avoid the passthrough method on line 115 and instead have one function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used in the Atlas error struct, see here

Copy link
Contributor

Choose a reason for hiding this comment

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

It's in the Atlas error struct but besides tests, is there another value passed other than -1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see what you mean, good call 👍
I've removed the method and set the status code in the event to -1 for now, will remove the field from the schema in a separate PR.

UseProtoNames: true,
EmitUnpopulated: true,
}.Format(msg)
m.lggr.Infow("[Beholder.emit]", "message", mStr, "attributes", attrKVs)
Copy link
Contributor

@dimriou dimriou Jan 30, 2026

Choose a reason for hiding this comment

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

I'm on the fence as to whether this needs to be info or debug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should only get a lot of errors in case of erroneous circumstances, then I think it'd be good to have these logs

Copy link
Contributor

Choose a reason for hiding this comment

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

But since this is a node log, we get this information from other sources as well, so this just confirms that it sends the Beholder message on an info level. Anyway, as I mentioned, I don't have a strong preference so we can keep it like that.

@cll-gg cll-gg requested a review from dimriou February 2, 2026 15:55
@cll-gg cll-gg marked this pull request as draft February 2, 2026 16:41
@cll-gg cll-gg marked this pull request as ready for review February 2, 2026 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ErrorType: errType,
ErrorMessage: cause.Error(),
HttpStatusCode: int32(httpStatusCode),
TransactionId: int64(tx.ID), //nolint:gosec // overflow is acceptable for telemetry
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The comment states 'overflow is acceptable for telemetry' but doesn't explain the implications. Consider documenting what happens if overflow occurs and why it's acceptable, or what the expected range of tx.ID values is.

Suggested change
TransactionId: int64(tx.ID), //nolint:gosec // overflow is acceptable for telemetry
// We deliberately cast tx.ID to int64 for the telemetry-only TransactionId field.
// The underlying tx.ID type may be wider than int64, so in theory this cast can
// overflow and wrap according to Go's integer conversion rules. If that happens,
// only the TransactionId reported in telemetry is affected; it does not influence
// on-chain behaviour, database primary keys, or any safety-critical logic.
// In practice, tx.ID values are expected to remain within the int64 range for the
// lifetime of the service, so overflow is not expected in normal operation.
TransactionId: int64(tx.ID), //nolint:gosec // see comment above for justification

Copilot uses AI. Check for mistakes.
@cll-gg cll-gg requested a review from a team February 2, 2026 17:41
@cll-gg cll-gg merged commit f0190ba into develop Feb 3, 2026
33 checks passed
@cll-gg cll-gg deleted the OEV-779-add-metrics-to-ofa-traffic branch February 3, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants