Skip to content

Add WithClientName#2246

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

Add WithClientName#2246
thomaska wants to merge 3 commits into
mainfrom
infoplat-14703-chip_client-label-2

Conversation

@thomaska

@thomaska thomaska commented Jul 13, 2026

Copy link
Copy Markdown

https://smartcontract-it.atlassian.net/browse/INFOPLAT-14703
Add chip-client in chip ingress

Supports

#2228

Copilot AI review requested due to automatic review settings July 13, 2026 17:47
@thomaska thomaska requested a review from a team as a code owner July 13, 2026 17:47
@github-actions

Copy link
Copy Markdown
Contributor

👋 thomaska, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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

✅ Compatible Changes (3)

batch (3)
  • ClientNameBeholder — ➕ Added

  • ClientNameDurableEmitter — ➕ Added

  • WithClientName — ➕ Added


📄 View full apidiff report

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

This PR adds an optional chip_client metric label to the Chip Ingress batch client, enabling downstream systems to attribute batch client metrics to a specific producer/client identity (e.g., beholder, durable_emitter).

Changes:

  • Introduces WithChipClient(name string) to set an optional chip_client label on all batch client metrics.
  • Propagates chip_client into batch client metric attribute sets (status counters, config gauge, split/mismatch counters, and size/latency histograms).
  • Adds tests asserting chip_client is present when configured and omitted otherwise, plus introduces well-known chip_client constant values.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/chipingress/batch/client.go Adds chipClient option plumbing and ensures all batch metrics include/omit the chip_client attribute consistently.
pkg/chipingress/batch/client_test.go Adds coverage verifying chip_client labeling behavior across all batch metrics.
pkg/chipingress/batch/chip_client.go Defines well-known chip_client label values for consistent usage across callers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/chipingress/batch/client.go Outdated
var chipClientAttr otelmetric.MeasurementOption
if chipClient != "" {
chipClientAttr = otelmetric.WithAttributeSet(attribute.NewSet(
attribute.String("chip_client", chipClient),

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.

Suggested change
attribute.String("chip_client", chipClient),
attribute.String("client_name", chipClient),

Comment thread pkg/chipingress/batch/chip_client.go Outdated
// Well-known chip_client metric label values for batch client metrics.
// Pass to WithChipClient when wiring batch.NewBatchClient.
const (
ChipClientBeholder = "beholder"

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.

Move these to pkg/chipingress/batch/client.go please

Comment thread pkg/chipingress/batch/client.go Outdated
}

// WithChipClient sets chip_client on batch client metrics. Omitted when unset.
func WithChipClient(name string) Opt {

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.

Suggested change
func WithChipClient(name string) Opt {
func WithClientName(name string) Opt {

Comment thread pkg/chipingress/batch/client.go Outdated
// WithChipClient sets chip_client on batch client metrics. Omitted when unset.
func WithChipClient(name string) Opt {
return func(c *Client) {
c.chipClient = name

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.

Suggested change
c.chipClient = name
c.clientName = name

pkcll
pkcll previously approved these changes Jul 13, 2026

@github-actions github-actions Bot 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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: d11931d Previous: c9ce07a Ratio
BenchmarkKeystore_Sign/nop/out-of-process 94030 ns/op 43993 ns/op 2.14

This comment was automatically generated by workflow using github-action-benchmark.

@thomaska thomaska changed the title Add WithChipClient Add WithClientName Jul 15, 2026
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.

3 participants