Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ func newBeholderClient(
LogMaxQueueSize: cfgTelemetry.LogMaxQueueSize(),
// Due to OpenTelemetry semantics, histogram bucket boundaries must be set
// when the Beholder client is constructed.
MetricViews: metricViews(),
MetricCardinalityLimit: cfgTelemetry.MetricCardinalityLimit(),
MetricViews: metricViews(),
MetricCardinalityLimit: cfgTelemetry.MetricCardinalityLimit(),
MetricViewsDisabled: cfgTelemetry.MetricViewsDisabled(),
MetricViewsAttributeBlacklist: cfgTelemetry.MetricViewsAttributeBlacklist(),
}

if cfgTracing.Enabled() {
Expand Down
4 changes: 4 additions & 0 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,10 @@ LogExportInterval = '1s' # Default
LogMaxQueueSize = 2048 # Default
# MetricCardinalityLimit sets the OTel SDK per-instrument attribute-set limit (0 disables).
MetricCardinalityLimit = 100000 # Default
# MetricViewsDisabled skips default Beholder metric attribute deny views.
MetricViewsDisabled = false # Default
# MetricViewsAttributeBlacklist lists attribute keys dropped before export (e.g. event_id).
MetricViewsAttributeBlacklist = ['event_id'] # Default

# ResourceAttributes are global metadata to include with all telemetry.
[Telemetry.ResourceAttributes]
Expand Down
2 changes: 2 additions & 0 deletions core/config/telemetry_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type Telemetry interface {
LogExportInterval() time.Duration
LogMaxQueueSize() int
MetricCardinalityLimit() int
MetricViewsDisabled() bool
MetricViewsAttributeBlacklist() []string
PrometheusBridge() PrometheusBridge
}

Expand Down
9 changes: 9 additions & 0 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,9 @@

MetricCardinalityLimit *int

MetricViewsDisabled *bool

Check warning on line 3000 in core/config/toml/types.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

File is not properly formatted

[goimports.bug.major] null See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=ba3f0109-6565-464c-8f45-98ddbf281aaa&open=ba3f0109-6565-464c-8f45-98ddbf281aaa
MetricViewsAttributeBlacklist []string

PrometheusBridge PrometheusBridge `toml:",omitempty"`
}

Expand Down Expand Up @@ -3067,6 +3070,12 @@
if v := f.MetricCardinalityLimit; v != nil {
b.MetricCardinalityLimit = v
}
if v := f.MetricViewsDisabled; v != nil {
b.MetricViewsDisabled = v
}
if v := f.MetricViewsAttributeBlacklist; v != nil {
b.MetricViewsAttributeBlacklist = v
}
b.PrometheusBridge.setFrom(&f.PrometheusBridge)
}

Expand Down
11 changes: 11 additions & 0 deletions core/services/chainlink/config_telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ func (b *telemetryConfig) MetricCardinalityLimit() int {
return *b.s.MetricCardinalityLimit
}

func (b *telemetryConfig) MetricViewsDisabled() bool {
if b.s.MetricViewsDisabled == nil {
return false
}
return *b.s.MetricViewsDisabled
}

func (b *telemetryConfig) MetricViewsAttributeBlacklist() []string {
return b.s.MetricViewsAttributeBlacklist
}

func (b *telemetryConfig) PrometheusBridge() config.PrometheusBridge {
return &prometheusBridgeConfig{b.s.PrometheusBridge}
}
Expand Down
38 changes: 38 additions & 0 deletions core/services/chainlink/config_telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,41 @@
})
}
}

func TestTelemetryConfig_MetricViewsDisabled(t *testing.T) {

Check warning on line 420 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

Function TestTelemetryConfig_MetricViewsDisabled missing the call to method parallel

[paralleltest.bug.major] Issue raised by paralleltest See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=1b92c3e9-2086-4f41-a4ec-5c94ab95ec5d&open=1b92c3e9-2086-4f41-a4ec-5c94ab95ec5d
tests := []struct {
name string
telemetry toml.Telemetry
expected bool
}{
{"MetricViewsDisabledTrue", toml.Telemetry{MetricViewsDisabled: ptr(true)}, true},

Check warning on line 426 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

newexpr: call of ptr(x) can be simplified to new(x)

[modernize.bug.major] null See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=d8e1017c-993a-4eb8-8098-bf639dca974c&open=d8e1017c-993a-4eb8-8098-bf639dca974c
{"MetricViewsDisabledFalse", toml.Telemetry{MetricViewsDisabled: ptr(false)}, false},

Check warning on line 427 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

newexpr: call of ptr(x) can be simplified to new(x)

[modernize.bug.major] null See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=bcd4eeba-b354-4239-8f6e-e351df22deff&open=bcd4eeba-b354-4239-8f6e-e351df22deff
{"MetricViewsDisabledNil", toml.Telemetry{MetricViewsDisabled: nil}, false},
}

for _, tt := range tests {

Check warning on line 431 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

Range statement for test TestTelemetryConfig_MetricViewsDisabled missing the call to method parallel in test Run

[paralleltest.bug.major] Issue raised by paralleltest See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=6316346a-6842-4484-8fae-0a5633baf79c&open=6316346a-6842-4484-8fae-0a5633baf79c
t.Run(tt.name, func(t *testing.T) {
tc := telemetryConfig{s: tt.telemetry}
assert.Equal(t, tt.expected, tc.MetricViewsDisabled())
})
}
}

func TestTelemetryConfig_MetricViewsAttributeBlacklist(t *testing.T) {

Check warning on line 439 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

Function TestTelemetryConfig_MetricViewsAttributeBlacklist missing the call to method parallel

[paralleltest.bug.major] Issue raised by paralleltest See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=67cbc146-5de5-40f6-825c-d25074ce1ead&open=67cbc146-5de5-40f6-825c-d25074ce1ead
tests := []struct {
name string
telemetry toml.Telemetry
expected []string
}{
{"BlacklistSet", toml.Telemetry{MetricViewsAttributeBlacklist: []string{"event_id"}}, []string{"event_id"}},
{"BlacklistNil", toml.Telemetry{MetricViewsAttributeBlacklist: nil}, nil},
{"BlacklistEmpty", toml.Telemetry{MetricViewsAttributeBlacklist: []string{}}, []string{}},
}

for _, tt := range tests {

Check warning on line 450 in core/services/chainlink/config_telemetry_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

Range statement for test TestTelemetryConfig_MetricViewsAttributeBlacklist missing the call to method parallel in test Run

[paralleltest.bug.major] Issue raised by paralleltest See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=9825d574-6f61-473b-bbf4-a14fc3a872fc&open=9825d574-6f61-473b-bbf4-a14fc3a872fc
t.Run(tt.name, func(t *testing.T) {
tc := telemetryConfig{s: tt.telemetry}
assert.Equal(t, tt.expected, tc.MetricViewsAttributeBlacklist())
})
}
}
2 changes: 2 additions & 0 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@
LogExportInterval: ptrDuration(1 * time.Second),
LogMaxQueueSize: ptrInt(2048),
MetricCardinalityLimit: ptrInt(100000),
MetricViewsDisabled: ptr(false),

Check warning on line 576 in core/services/chainlink/config_test.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

newexpr: call of ptr(x) can be simplified to new(x)

[modernize.bug.major] null See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_chainlink&pullRequest=23085&issues=0f37b1dc-a61f-4e52-9f79-1742f537dfbe&open=0f37b1dc-a61f-4e52-9f79-1742f537dfbe
MetricViewsAttributeBlacklist: []string{"event_id"},

PrometheusBridge: toml.PrometheusBridge{
Enabled: ptr(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ LogExportMaxBatchSize = 512
LogExportInterval = '1s'
LogMaxQueueSize = 2048
MetricCardinalityLimit = 100000
MetricViewsDisabled = false
MetricViewsAttributeBlacklist = ['event_id']

[Telemetry.PrometheusBridge]
Enabled = false
Expand Down
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ LogExportMaxBatchSize = 512
LogExportInterval = '1s'
LogMaxQueueSize = 2048
MetricCardinalityLimit = 100000
MetricViewsDisabled = false
MetricViewsAttributeBlacklist = ['event_id']

[Telemetry.ResourceAttributes]
Baz = 'test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ LogExportMaxBatchSize = 512
LogExportInterval = '1s'
LogMaxQueueSize = 2048
MetricCardinalityLimit = 100000
MetricViewsDisabled = false
MetricViewsAttributeBlacklist = ['event_id']

[Telemetry.PrometheusBridge]
Enabled = false
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ require (
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccv v0.0.2-0.20260706093831-dad26b360094
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260710231428-a7dbabb63d6e
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260711201826-6a12990d60b7
github.com/smartcontractkit/chainlink-common/keystore v1.2.0
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260626151909-052e55e62e62
github.com/smartcontractkit/chainlink-data-streams v0.1.15-0.20260522094612-5f9f748bd87a
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions plugins/loop_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ func (m *LoopRegistry) Register(id string) (*RegisteredLoop, error) {
envCfg.TelemetryLogMaxQueueSize = m.cfgTelemetry.LogMaxQueueSize()
limit := m.cfgTelemetry.MetricCardinalityLimit()
envCfg.TelemetryMetricCardinalityLimit = &limit
envCfg.TelemetryMetricViewsDisabled = m.cfgTelemetry.MetricViewsDisabled()
envCfg.TelemetryMetricViewsAttributeBlacklist = m.cfgTelemetry.MetricViewsAttributeBlacklist()
envCfg.TelemetryPrometheusBridgeEnabled = m.cfgTelemetry.PrometheusBridge().Enabled()
envCfg.TelemetryPrometheusBridgePrefixes = m.cfgTelemetry.PrometheusBridge().Prefixes()
}
Expand Down
8 changes: 8 additions & 0 deletions plugins/loop_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ func (m mockCfgTelemetry) LogMaxQueueSize() int { return 2048 }

func (m mockCfgTelemetry) MetricCardinalityLimit() int { return 100000 }

func (m mockCfgTelemetry) MetricViewsDisabled() bool { return false }

func (m mockCfgTelemetry) MetricViewsAttributeBlacklist() []string {
return []string{"event_id"}
}

func (m mockCfgTelemetry) PrometheusBridge() config.PrometheusBridge {
return mockPrometheusBridge{}
}
Expand Down Expand Up @@ -254,6 +260,8 @@ func TestLoopRegistry_Register(t *testing.T) {
require.Equal(t, 2048, envCfg.TelemetryLogMaxQueueSize)
require.NotNil(t, envCfg.TelemetryMetricCardinalityLimit)
require.Equal(t, 100000, *envCfg.TelemetryMetricCardinalityLimit)
require.False(t, envCfg.TelemetryMetricViewsDisabled)
require.Equal(t, []string{"event_id"}, envCfg.TelemetryMetricViewsAttributeBlacklist)

require.Equal(t, "example.com/chip-ingress", envCfg.ChipIngressEndpoint)
require.False(t, envCfg.ChipIngressBatchEmitterEnabled)
Expand Down
Loading