-
Notifications
You must be signed in to change notification settings - Fork 47
Add monitoring for config digest missmatch #2068
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
Changes from all commits
8a66ffe
edf0f0e
d877942
b12e493
8ae52de
7608852
0bdb3ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,10 @@ var ( | |
| Name: "ccip_commit_loopp_ccip_provider_supported", | ||
| Help: "Tracks whether LOOPP CCIP provider is supported for each chain family (1 = supported, 0 = not supported)", | ||
| }, []string{"chain_family"}) | ||
| promCommitConfigDigestMismatch = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
| Name: "ccip_commit_config_digest_mismatch", | ||
| Help: "Reports whether the home chain config digest differs from the offramp config digest (1 = mismatch, 0 = match)", | ||
| }, []string{"chain_family", "chain_id"}) | ||
| ) | ||
|
|
||
| type PromReporter struct { | ||
|
|
@@ -116,6 +120,9 @@ type PromReporter struct { | |
| bhSequenceNumbers metric.Int64Gauge | ||
| bhCommitLatestRound metric.Int64Gauge | ||
| bhLooppProviderSupported metric.Int64Gauge | ||
|
|
||
| configDigestMismatch *prometheus.GaugeVec | ||
| bhConfigDigestMismatch metric.Int64Gauge | ||
| } | ||
|
|
||
| func NewPromReporter( | ||
|
|
@@ -149,6 +156,10 @@ func NewPromReporter( | |
| if err != nil { | ||
| return nil, fmt.Errorf("failed to register ccip_commit_loopp_ccip_provider_supported gauge: %w", err) | ||
| } | ||
| configDigestMismatch, err := bhClient.Meter.Int64Gauge("ccip_commit_config_digest_mismatch") | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to register ccip_commit_config_digest_mismatch gauge: %w", err) | ||
| } | ||
|
|
||
| return &PromReporter{ | ||
| lggr: lggr, | ||
|
|
@@ -162,6 +173,7 @@ func NewPromReporter( | |
| sequenceNumbers: promSequenceNumbers, | ||
| commitLatestRound: promCommitLatestRoundID, | ||
| looppProviderSupported: promLooppCCIPProviderSupported, | ||
| configDigestMismatch: promCommitConfigDigestMismatch, | ||
|
|
||
| processorLatencyHistogram: promProcessorLatencyHistogram, | ||
| processorOutputCounter: promProcessorOutputCounter, | ||
|
|
@@ -173,6 +185,7 @@ func NewPromReporter( | |
| bhSequenceNumbers: sequenceNumbers, | ||
| bhCommitLatestRound: commitLatestRoundID, | ||
| bhLooppProviderSupported: looppProviderSupported, | ||
| bhConfigDigestMismatch: configDigestMismatch, | ||
| }, nil | ||
| } | ||
|
|
||
|
|
@@ -340,3 +353,15 @@ func (p *PromReporter) TrackLooppProviderSupported(looppCCIPProviderSupported ma | |
| )) | ||
| } | ||
| } | ||
|
|
||
| func (p *PromReporter) TrackConfigDigestMismatch(mismatch bool) { | ||
| var value float64 | ||
| if mismatch { | ||
| value = 1 | ||
| } | ||
| p.configDigestMismatch.WithLabelValues(p.chainFamily, p.chainID).Set(value) | ||
| p.bhConfigDigestMismatch.Record(context.Background(), int64(value), metric.WithAttributes( | ||
| attribute.String("chain_family", p.chainFamily), | ||
| attribute.String("chain_id", p.chainID), | ||
| )) | ||
|
Comment on lines
+363
to
+366
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I see the use of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The beholder Record/Add calls are non-blocking ops - they buffer metrics for async export |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should these metric names be
const? They are referred to in multiple places by the string literal, which as we see in this file can quickly go out of sync.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it can be the way to go. I'm just wondering if we should start with having one metric as const leaving the rest for the other PR is. WDYT @makramkd ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its fine if we do the cleanup in a follow-up.