Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/empty-bees-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#updated chip-ingress client
2 changes: 1 addition & 1 deletion core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTeleme
AuthHeaders: beholderAuthHeaders,
ChipIngressEmitterEnabled: cfgTelemetry.ChipIngressEndpoint() != "",
ChipIngressEmitterGRPCEndpoint: cfgTelemetry.ChipIngressEndpoint(),
ChipIngressInsecureConnection: cfgTelemetry.InsecureConnection(),
ChipIngressInsecureConnection: cfgTelemetry.ChipIngressInsecureConnection(),
LogStreamingEnabled: cfgTelemetry.LogStreamingEnabled(),
}
// note: due to the OTEL specification, all histogram buckets
Expand Down
3 changes: 3 additions & 0 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@ EmitterBatchProcessor = true # Default
EmitterExportTimeout = '1s' # Default
# ChipIngressEndpoint enables sending custom messages to CHIP Ingress.
ChipIngressEndpoint = '' # Default
# ChipIngressInsecureConnection disables TLS when connecting to CHIP Ingress.
ChipIngressInsecureConnection = false # Default

# HeartbeatInterval is the interval at which a the application heartbeat is sent to telemetry backends.
HeartbeatInterval = '1s' # Default
# LogStreamingEnabled enables log streaming to the OTel log exporter
Expand Down
1 change: 1 addition & 0 deletions core/config/telemetry_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Telemetry interface {
EmitterBatchProcessor() bool
EmitterExportTimeout() time.Duration
ChipIngressEndpoint() string
ChipIngressInsecureConnection() bool
HeartbeatInterval() time.Duration
LogStreamingEnabled() bool
}
26 changes: 15 additions & 11 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2269,17 +2269,18 @@ func (t *Tracing) ValidateConfig() (err error) {
}

type Telemetry struct {
Enabled *bool
CACertFile *string
Endpoint *string
InsecureConnection *bool
ResourceAttributes map[string]string `toml:",omitempty"`
TraceSampleRatio *float64
EmitterBatchProcessor *bool
EmitterExportTimeout *commonconfig.Duration
ChipIngressEndpoint *string
HeartbeatInterval *commonconfig.Duration
LogStreamingEnabled *bool
Enabled *bool
CACertFile *string
Endpoint *string
InsecureConnection *bool
ResourceAttributes map[string]string `toml:",omitempty"`
TraceSampleRatio *float64
EmitterBatchProcessor *bool
EmitterExportTimeout *commonconfig.Duration
ChipIngressEndpoint *string
ChipIngressInsecureConnection *bool
HeartbeatInterval *commonconfig.Duration
LogStreamingEnabled *bool
}

func (b *Telemetry) setFrom(f *Telemetry) {
Expand Down Expand Up @@ -2310,6 +2311,9 @@ func (b *Telemetry) setFrom(f *Telemetry) {
if v := f.ChipIngressEndpoint; v != nil {
b.ChipIngressEndpoint = v
}
if v := f.ChipIngressInsecureConnection; v != nil {
b.ChipIngressInsecureConnection = v
}
if v := f.HeartbeatInterval; v != nil {
b.HeartbeatInterval = v
}
Expand Down
5 changes: 5 additions & 0 deletions core/scripts/cre/environment/configs/workflow-don.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
InsecureConnection = true
ChipIngressInsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'

Expand All @@ -98,6 +99,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand All @@ -121,6 +123,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand All @@ -144,6 +147,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand All @@ -167,6 +171,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down Expand Up @@ -117,6 +118,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down Expand Up @@ -160,6 +162,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down Expand Up @@ -114,6 +115,7 @@
Enabled = true
Endpoint = 'host.docker.internal:4317'
ChipIngressEndpoint = 'chip-ingress:50051'
ChipIngressInsecureConnection = true
InsecureConnection = true
TraceSampleRatio = 1
HeartbeatInterval = '30s'
Expand Down
7 changes: 7 additions & 0 deletions core/services/chainlink/config_telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ func (b *telemetryConfig) ChipIngressEndpoint() string {
return *b.s.ChipIngressEndpoint
}

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

func (b *telemetryConfig) HeartbeatInterval() time.Duration {
if b.s.HeartbeatInterval == nil || b.s.HeartbeatInterval.Duration() <= 0 {
return defaultHeartbeatInterval
Expand Down
18 changes: 18 additions & 0 deletions core/services/chainlink/config_telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,24 @@ func TestTelemetryConfig_ChipIngressEndpoint(t *testing.T) {
}
}

func TestTelemetryConfig_ChipIngressInsecureConnection(t *testing.T) {
tests := []struct {
name string
telemetry toml.Telemetry
expected bool
}{
{"ChipIngressInsecureConnectionTrue", toml.Telemetry{ChipIngressInsecureConnection: ptr(true)}, true},
{"ChipIngressInsecureConnectionFalse", toml.Telemetry{ChipIngressInsecureConnection: ptr(false)}, false},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tc := telemetryConfig{s: tt.telemetry}
assert.Equal(t, tt.expected, tc.ChipIngressInsecureConnection())
})
}
}

func ptrDuration(d time.Duration) *config.Duration {
return config.MustNewDuration(d)
}
Expand Down
23 changes: 12 additions & 11 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,17 +582,18 @@ func TestConfig_Marshal(t *testing.T) {
Release: ptr("v1.2.3"),
}
full.Telemetry = toml.Telemetry{
Enabled: ptr(true),
CACertFile: ptr("cert-file"),
Endpoint: ptr("example.com/collector"),
InsecureConnection: ptr(true),
ResourceAttributes: map[string]string{"Baz": "test", "Foo": "bar"},
TraceSampleRatio: ptr(0.01),
EmitterBatchProcessor: ptr(true),
EmitterExportTimeout: commoncfg.MustNewDuration(1 * time.Second),
ChipIngressEndpoint: ptr("example.com/chip-ingress"),
HeartbeatInterval: commoncfg.MustNewDuration(1 * time.Second),
LogStreamingEnabled: ptr(false),
Enabled: ptr(true),
CACertFile: ptr("cert-file"),
Endpoint: ptr("example.com/collector"),
InsecureConnection: ptr(true),
ResourceAttributes: map[string]string{"Baz": "test", "Foo": "bar"},
TraceSampleRatio: ptr(0.01),
EmitterBatchProcessor: ptr(true),
EmitterExportTimeout: commoncfg.MustNewDuration(1 * time.Second),
ChipIngressEndpoint: ptr("example.com/chip-ingress"),
ChipIngressInsecureConnection: ptr(false),
HeartbeatInterval: commoncfg.MustNewDuration(1 * time.Second),
LogStreamingEnabled: ptr(false),
}
full.CRE = toml.CreConfig{
Streams: &toml.StreamsConfig{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = 'example.com/chip-ingress'
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = 'example.com/chip-ingress'
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
7 changes: 7 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,7 @@ TraceSampleRatio = 0.01 # Default
EmitterBatchProcessor = true # Default
EmitterExportTimeout = '1s' # Default
ChipIngressEndpoint = '' # Default
ChipIngressInsecureConnection = false # Default
HeartbeatInterval = '1s' # Default
LogStreamingEnabled = false # Default
```
Expand Down Expand Up @@ -2285,6 +2286,12 @@ ChipIngressEndpoint = '' # Default
```
ChipIngressEndpoint enables sending custom messages to CHIP Ingress.

### ChipIngressInsecureConnection
```toml
ChipIngressInsecureConnection = false # Default
```
ChipIngressInsecureConnection disables TLS when connecting to CHIP Ingress.

### HeartbeatInterval
```toml
HeartbeatInterval = '1s' # Default
Expand Down
1 change: 1 addition & 0 deletions plugins/loop_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (m *LoopRegistry) Register(id string) (*RegisteredLoop, error) {
envCfg.TelemetryEmitterExportTimeout = m.cfgTelemetry.EmitterExportTimeout()
envCfg.TelemetryAuthPubKeyHex = m.telemetryAuthPubKeyHex
envCfg.ChipIngressEndpoint = m.cfgTelemetry.ChipIngressEndpoint()
envCfg.ChipIngressInsecureConnection = m.cfgTelemetry.ChipIngressInsecureConnection()
envCfg.TelemetryLogStreamingEnabled = m.cfgTelemetry.LogStreamingEnabled()
}
m.lggr.Debugf("Registered loopp %q with port %d", id, envCfg.PrometheusPort)
Expand Down
2 changes: 2 additions & 0 deletions plugins/loop_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func (m mockCfgTelemetry) EmitterExportTimeout() time.Duration { return 1 * time

func (m mockCfgTelemetry) ChipIngressEndpoint() string { return "example.com/chip-ingress" }

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

func (m mockCfgTelemetry) HeartbeatInterval() time.Duration {
return 5 * time.Second
}
Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/config/merge_raw_configs.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/default.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/defaults-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/disk-based-logging.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/fallback-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/invalid-ocr-p2p.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/valid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
1 change: 1 addition & 0 deletions testdata/scripts/node/validate/warnings.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'
ChipIngressEndpoint = ''
ChipIngressInsecureConnection = false
HeartbeatInterval = '1s'
LogStreamingEnabled = false

Expand Down
Loading