Skip to content

Commit

Permalink
INFOPLAT1-1562 Reconfigures loops to use AuthHeaderProvider
Browse files Browse the repository at this point in the history
keeps old struct fields, to not break build. Will circle back to removing them one, this PR has been integrated into chainlink node
  • Loading branch information
hendoxc committed Dec 23, 2024
1 parent 2bb5c5c commit 963f8c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/loop/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/hashicorp/go-plugin"
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
)

const (
Expand Down Expand Up @@ -57,6 +58,7 @@ type EnvConfig struct {
TelemetryTraceSampleRatio float64
TelemetryAuthHeaders map[string]string
TelemetryAuthPubKeyHex string
TelemetryAuthHeaderProvider beholder.AuthHeaderProvider
TelemetryEmitterBatchProcessor bool
TelemetryEmitterExportTimeout time.Duration
TelemetryEmitterExportInterval time.Duration
Expand Down Expand Up @@ -92,11 +94,6 @@ func (e *EnvConfig) AsCmdEnv() (env []string) {
for k, v := range e.TelemetryAttributes {
add(envTelemetryAttribute+k, v)
}

for k, v := range e.TelemetryAuthHeaders {
add(envTelemetryAuthHeader+k, v)
}
add(envTelemetryAuthPubKeyHex, e.TelemetryAuthPubKeyHex)
add(envTelemetryEmitterBatchProcessor, strconv.FormatBool(e.TelemetryEmitterBatchProcessor))
add(envTelemetryEmitterExportTimeout, e.TelemetryEmitterExportTimeout.String())
add(envTelemetryEmitterExportInterval, e.TelemetryEmitterExportInterval.String())
Expand Down Expand Up @@ -148,8 +145,6 @@ func (e *EnvConfig) parse() error {
e.TelemetryCACertFile = os.Getenv(envTelemetryCACertFile)
e.TelemetryAttributes = getMap(envTelemetryAttribute)
e.TelemetryTraceSampleRatio = getFloat64OrZero(envTelemetryTraceSampleRatio)
e.TelemetryAuthHeaders = getMap(envTelemetryAuthHeader)
e.TelemetryAuthPubKeyHex = os.Getenv(envTelemetryAuthPubKeyHex)
e.TelemetryEmitterBatchProcessor, err = getBool(envTelemetryEmitterBatchProcessor)
if err != nil {
return fmt.Errorf("failed to parse %s: %w", envTelemetryEmitterBatchProcessor, err)
Expand Down
1 change: 1 addition & 0 deletions pkg/loop/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (s *Server) start() error {
TraceSampleRatio: envCfg.TelemetryTraceSampleRatio,
AuthHeaders: envCfg.TelemetryAuthHeaders,
AuthPublicKeyHex: envCfg.TelemetryAuthPubKeyHex,
AuthHeaderProvider: envCfg.TelemetryAuthHeaderProvider,
EmitterBatchProcessor: envCfg.TelemetryEmitterBatchProcessor,
EmitterExportTimeout: envCfg.TelemetryEmitterExportTimeout,
EmitterExportInterval: envCfg.TelemetryEmitterExportInterval,
Expand Down

0 comments on commit 963f8c3

Please sign in to comment.