Skip to content

Remove duplicate lifecycle telemetry from Stellar actions - #861

Draft
ilija42 wants to merge 1 commit into
mainfrom
feat/stellar-action-metrics-dedup
Draft

ilija42 wants to merge 1 commit into
mainfrom
feat/stellar-action-metrics-dedup

Conversation

@ilija42

@ilija42 ilija42 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #859 (merged). Removes the duplicate lifecycle telemetry from Stellar actions.

Now that the auto-generated v2 server wrapper (chainlink-common #2502) emits Capability Initiated / Succeeded / Failed logs and capabilities_v2_action_count / capabilities_v2_action_duration OTel metrics for every RPC, the hand-written EmitInitiated / LogAndEmitError / LogAndEmitSuccess calls in the action code emit the same lifecycle events a second time through a parallel path. Drop them.

@ilija42
ilija42 requested review from a team as code owners October 27, 2026 20:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T16:55:30.408491Z
We couldn’t complete this review. Comment @codex review to try again.
e63c81f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ilija42
ilija42 marked this pull request as draft October 27, 2026 20:56
@ilija42
ilija42 force-pushed the feat/stellar-action-metrics-dedup branch 2 times, most recently from 4424a47 to e63c81f Compare October 27, 2026 21:38
@ilija42
ilija42 marked this pull request as ready for review October 28, 2026 16:55
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

pavel-raykov
pavel-raykov previously approved these changes Oct 28, 2026
@ilija42
ilija42 marked this pull request as draft October 29, 2026 12:10
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 30 days with no activity.
Remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Nov 29, 2026
The v2 generated server wrapper (--with-monitoring, chainlink-common

- "Capability Initiated" / "Capability Succeeded" / "Capability Failed"
  structured log lines
- capabilities_v2_action_count and capabilities_v2_action_duration
  OTel metrics with method + outcome labels

for every RPC. The manual EmitInitiated / LogAndEmitError /
LogAndEmitSuccess calls in the action implementations produce a second,
parallel stream of the same lifecycle events. Remove them.

Removals:

- actions/actions.go (ReadContract) and actions/write_report.go
  (WriteReport): drop the top-level EmitInitiated / LogAndEmitError /
  LogAndEmitSuccess calls. The ad-hoc "Received X request" Debug log
  on ReadContract is also dropped (the wrapper's "Capability
  Initiated" subsumes it).

- monitoring/messages.go: drop BuildReadContractInitiated/Success/Error
  and BuildWriteReportInitiated/Success/Error builders, their
  LogAttributes / MetricAttributes methods, and the now-unused
  convertReadContractRequest / readContractRequestLogAttributes /
  appendUserErrorLogAttributes helpers.

- monitoring/processor.go: drop the ReadContract* / WriteReport
  Initiated/Success/Error cases from both metricsHandler and Process.

- monitoring/metrics.go: drop the ReadContract* / WriteReport
  Success/Error instruments from Metrics and NewMetrics. Comment on
  the struct now documents that only sub-execution events live here.

- monitoring/read_contract.proto + read_contract.pb.go: deleted; all
  message types in the file were lifecycle-only.

- monitoring/write_report.proto + write_report.pb.go: drop the
  Initiated / Success / Error message types; TxInfoRetrievalError,
  InvalidTransmissionState, DuplicateTx, and SuccessfulEarlyReturn are
  kept (they cover paths the wrapper does not).

- Tests: drop cases covering removed types; add a focused test
  pinning CapabilityMetricsAttributes labels (previously uncovered).

Sub-execution events that the generated wrapper does NOT cover
(DuplicateTx, TxInfoRetrievalError, InvalidTransmissionState,
SuccessfulEarlyReturn) are intentionally preserved on the legacy
Beholder path. Migrating those to OTel is out of scope for this PR.

Runbook impact: alerts and dashboards reading the legacy
stellar_capability_{read_contract,write_report}_{success,error}_*count*
series, or the corresponding [Stellar Monitoring] log lines with
entity_name in {ReadContractInitiated, ReadContractSuccess,
ReadContractError, WriteReportInitiated, WriteReportSuccess,
WriteReportError}, must migrate to capabilities_v2_action_count and
capabilities_v2_action_duration filtered on capability_id and method
before this PR merges. Sub-execution alerts are unaffected.
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.

2 participants