Add chip_client metric label for Chip Ingress batch clients#2228
Open
thomaska wants to merge 3 commits into
Open
Add chip_client metric label for Chip Ingress batch clients#2228thomaska wants to merge 3 commits into
thomaska wants to merge 3 commits into
Conversation
Contributor
✅ API Diff Results -
|
Contributor
📊 API Diff Results
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a consistent chip_client metric label across Chip Ingress batch clients and aligns producer-side metrics (Beholder + Durable Emitter) so dashboards can attribute traffic correctly without proliferating “client variants”.
Changes:
- Add
WithChipClient()topkg/chipingress/batchand propagatechip_clientonto all batch-client metrics when configured. - Label Chip Ingress producers (e.g.,
beholder,durable_emitter) and record durable-emitter fallback publishes withchip_client="durable_emitter"andphase="fallback". - Bump
pkg/chipingressdependency to the commit containing the new option.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/durableemitter/setup.go | Sets WithChipClient("durable_emitter") on the batch client. |
| pkg/durableemitter/durable_emitter.go | Wires metrics with chip_client and records fallback publish metrics (phase fallback). |
| pkg/durableemitter/durable_emitter_metrics.go | Adds chip_client attribute to publish-related metrics and introduces fallback phase. |
| pkg/durableemitter/durable_emitter_test.go | Extends tests to assert chip_client + fallback phase labeling. |
| pkg/chipingress/batch/client.go | Introduces WithChipClient and applies chip_client attribute across batch client metrics. |
| pkg/chipingress/batch/client_test.go | Adds coverage verifying chip_client is present/omitted depending on configuration. |
| pkg/beholder/batch_emitter_service.go | Configures batch client + service metrics with chip_client="beholder". |
| pkg/beholder/batch_emitter_service_test.go | Updates assertions to require chip_client="beholder" on metrics. |
| go.mod | Bumps github.com/smartcontractkit/chainlink-common/pkg/chipingress version. |
| go.sum | Updates sums for the bumped chipingress dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
142
to
146
| if m.publishImmOK, err = meter.Int64Counter( | ||
| "durable_emitter.publish.immediate.success", | ||
| metric.WithUnit("{call}"), | ||
| metric.WithDescription("Immediate Publish RPC successes"), | ||
| metric.WithDescription("Single-event fallback Publish RPC successes; labels: phase={fallback}"), | ||
| ); err != nil { |
Comment on lines
149
to
153
| if m.publishImmErr, err = meter.Int64Counter( | ||
| "durable_emitter.publish.immediate.failure", | ||
| metric.WithUnit("{call}"), | ||
| metric.WithDescription("Immediate Publish RPC failures (events await retransmit)"), | ||
| metric.WithDescription("Single-event fallback Publish RPC failures (events await retransmit); labels: phase={fallback}"), | ||
| ); err != nil { |
Comment on lines
156
to
160
| if m.publishDuration, err = meter.Float64Histogram( | ||
| "durable_emitter.publish.duration", | ||
| metric.WithUnit("s"), | ||
| metric.WithDescription("Chip Ingress Publish RPC duration (seconds); labels: phase={batch,retransmit}, error={true,false}"), | ||
| metric.WithDescription("Chip Ingress Publish RPC duration (seconds); labels: phase={batch,retransmit,fallback}, error={true,false}"), | ||
| durationBuckets, |
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.
INFOPLAT-14703
Add WithChipClient() to pkg/chipingress/batch and propagate chip_client on all batch client metrics.
Label Chip Ingress producers as beholder, durable_emitter, etc. in beholder and durable emitter.
Record durable emitter fallback publishes with chip_client="durable_emitter" and phase="fallback" instead of a separate durable_emitter_fallback client.
Bump pkg/chipingress dependency to the commit that includes WithChipClient.