DF-21989: OCR2 transmit outcome metrics (TXM v1/v2)#398
Draft
cl-efornaciari wants to merge 3 commits intosmartcontractkit:developfrom
Draft
DF-21989: OCR2 transmit outcome metrics (TXM v1/v2)#398cl-efornaciari wants to merge 3 commits intosmartcontractkit:developfrom
cl-efornaciari wants to merge 3 commits intosmartcontractkit:developfrom
Conversation
cll-gg
reviewed
Mar 25, 2026
Comment on lines
+12
to
+27
| promTransmitConfirmed = promauto.NewCounterVec(prometheus.CounterOpts{ | ||
| Name: "ocr2_transmit_tx_confirmed_total", | ||
| Help: "OCR2 aggregator transmit transactions that received a successful on-chain receipt.", | ||
| }, []string{"chain_id", "contract_address", "from_address"}) | ||
| promTransmitReverted = promauto.NewCounterVec(prometheus.CounterOpts{ | ||
| Name: "ocr2_transmit_tx_reverted_total", | ||
| Help: "OCR2 aggregator transmit transactions that were included but reverted.", | ||
| }, []string{"chain_id", "contract_address", "from_address"}) | ||
| promTransmitFatal = promauto.NewCounterVec(prometheus.CounterOpts{ | ||
| Name: "ocr2_transmit_tx_fatal_total", | ||
| Help: "OCR2 aggregator transmit transactions marked fatally errored by TXM (e.g. could not get receipt).", | ||
| }, []string{"chain_id", "contract_address", "from_address"}) | ||
| promTransmitUnconfirmed = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
| Name: "ocr2_transmit_unconfirmed_tx_count", | ||
| Help: "Count of unconfirmed in-memory transactions whose calldata is an OCR2 transmit call (TXM v2 per from_address).", | ||
| }, []string{"chain_id", "from_address"}) |
Contributor
There was a problem hiding this comment.
Please use otel metrics instead of (or next to) prom metrics, then they will be ingested by Beholder and NOP metrics will be visible in Grafana
Record confirmed/reverted/fatal counters and unconfirmed gauge via beholder alongside Prometheus; pass context into RecordOutcome (DF-21989).
5ddb738 to
c8651a4
Compare
cll-gg
reviewed
Mar 26, 2026
pkg/ocr2transmit/metrics.go
Outdated
| ocr2TransmitOtelOnce.Do(func() { | ||
| m := beholder.GetMeter() | ||
| confirmed, err := m.Int64Counter("ocr2_transmit_tx_confirmed_total") | ||
| if err != nil { |
Contributor
There was a problem hiding this comment.
Should we at least print the error? Now it's getting swallowed
Singleton process metrics with methods RecordOutcome and SetUnconfirmedGauge; package functions delegate for unchanged call sites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Prometheus metrics for OCR2 aggregator
transmittransactions to support DF-21989 (duplicate PMAIs DF-22761 / DF-22643).Changes
pkg/ocr2transmit: detect OCR2transmitcalldata; shared countersocr2_transmit_tx_{confirmed,reverted,fatal}_totaland gaugeocr2_transmit_unconfirmed_tx_count.finalizerwhen receipts are processed or txs expire without receipt.MarkTxFatal; refresh unconfirmed OCR2-shaped tx gauge after backfill.Notes
Made with Cursor