Skip to content

mtca: first pass adding metrics for observability. - #9195

Open
ezekiel wants to merge 7 commits into
mainfrom
ezekiel/mtc-metrics-mtca
Open

ezekiel wants to merge 7 commits into
mainfrom
ezekiel/mtc-metrics-mtca

Conversation

@ezekiel

@ezekiel ezekiel commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

This is the first of at least three PRs to add metrics to the MTCA, MTCB, and MTPublisher.

@ezekiel ezekiel mentioned this pull request Nov 23, 2026
@ezekiel ezekiel self-assigned this Nov 23, 2026
@ezekiel
ezekiel requested a review from aarongable November 23, 2026 20:55
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
Comment thread mtca/mtca.go Resolved
@ezekiel
ezekiel marked this pull request as ready for review December 1, 2026 16:11
@ezekiel
ezekiel requested a review from a team as a code owner December 1, 2026 16:11
@ezekiel
ezekiel requested review from aarongable and jsha December 1, 2026 16:11
Comment thread mtca/mtca.go
Comment on lines +99 to +109
// A consistent "issuer" label makes every MTCA metric more ergonomic
// versus, for example, a deployment instance ID.
issueAttempts := issuerIssueAttempts.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
lastSeqSuccessTimestamp := issuerLastSeqSuccessTimestamp.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
pendingEntryPoolSize := issuerPendingEntryPoolSize.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
sequenceBatchSize := issuerSequenceBatchSize.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
sequenceDuration := issuerSequenceDuration.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
sequenceTxDuration := issuerSequenceTxDuration.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
signatureDurations := issuerSignatureDurations.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
tileStoreDurations := issuerTileStoreDurations.MustCurryWith(prometheus.Labels{"issuer": CAIDString})
treeSize := issuerTreeSize.MustCurryWith(prometheus.Labels{"issuer": CAIDString})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than declaring a second set of local variables, I would either:

  1. Inline these above (so issueAttempts := promauto.With(register).NewCounterVec(...).MustCurryWith(...)); or at least
  2. Reuse the same variables (so issueAttempts = issueAttempts.MustCurryWith(...))

Comment thread mtca/mtca.go

// pendingEntry represents a pending entry in the pool, along with a channel to
// notify a pending RPC. Each pendingEntry carries an RA-generated eventID.
// notify a pending RPC. Each pendingEntry carries an RA-generated eventID

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure why this comment lost its trailing period.

Comment thread mtca/mtca.go
@@ -375,8 +462,10 @@ func (m *mtca) Issue(ctx context.Context, req *mtcapb.IssueRequest) (*mtcapb.Iss
return nil, ctx.Err()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you want a m.metrics.issueAttempts.With({"result": "timed out"}).Inc() here. In fact there are quite a few error cases within this function that don't have corresponding metric increments.

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