Skip to content

Add chip_client metric label for Chip Ingress batch clients#2228

Open
thomaska wants to merge 3 commits into
mainfrom
infoplat-14703-chip_client-label
Open

Add chip_client metric label for Chip Ingress batch clients#2228
thomaska wants to merge 3 commits into
mainfrom
infoplat-14703-chip_client-label

Conversation

@thomaska

@thomaska thomaska commented Jul 7, 2026

Copy link
Copy Markdown

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.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

✅ API Diff Results - github.com/smartcontractkit/chainlink-common/pkg/chipingress

✅ Compatible Changes (1)

batch (1)
  • WithChipClient — ➕ Added

📄 View full apidiff report

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-common

View full report

@thomaska thomaska marked this pull request as ready for review July 8, 2026 14:00
@thomaska thomaska requested review from a team as code owners July 8, 2026 14:00
Copilot AI review requested due to automatic review settings July 8, 2026 14:00

Copilot AI left a comment

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.

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() to pkg/chipingress/batch and propagate chip_client onto all batch-client metrics when configured.
  • Label Chip Ingress producers (e.g., beholder, durable_emitter) and record durable-emitter fallback publishes with chip_client="durable_emitter" and phase="fallback".
  • Bump pkg/chipingress dependency 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,
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