Skip to content

Commit

Permalink
pkg/loop: include tracing attributes when enabled (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Sep 11, 2024
1 parent 4836d1d commit d00d518
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/loop/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"os"

"go.opentelemetry.io/otel/attribute"

"github.com/smartcontractkit/chainlink-common/pkg/beholder"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
Expand Down Expand Up @@ -84,11 +86,15 @@ func (s *Server) start() error {
return fmt.Errorf("failed to setup tracing: %w", err)
}
} else {
var attributes []attribute.KeyValue
if tracingConfig.Enabled {
attributes = tracingConfig.Attributes()
}
beholderCfg := beholder.Config{
InsecureConnection: envCfg.TelemetryInsecureConnection,
CACertFile: envCfg.TelemetryCACertFile,
OtelExporterGRPCEndpoint: envCfg.TelemetryEndpoint,
ResourceAttributes: append(tracingConfig.Attributes(), envCfg.TelemetryAttributes.AsStringAttributes()...),
ResourceAttributes: append(attributes, envCfg.TelemetryAttributes.AsStringAttributes()...),
TraceSampleRatio: envCfg.TelemetryTraceSampleRatio,
}

Expand Down

0 comments on commit d00d518

Please sign in to comment.