Skip to content
Merged
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
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type Config struct {
JaegerService string
OTLPAddress string
OTLPHeaders []string
OTLPInsecure bool
OTLPServiceName string
SimnetBMock bool
SimnetVMock bool
Expand Down Expand Up @@ -1127,7 +1128,7 @@ func wireTracing(life *lifecycle.Manager, conf Config, clusterHash []byte) error
}

stopTracer, err := tracer.Init(
tracer.WithOTLPTracer(conf.OTLPAddress, otlpHeaders),
tracer.WithOTLPTracer(conf.OTLPAddress, otlpHeaders, conf.OTLPInsecure),
tracer.WithServiceName(conf.OTLPServiceName),
tracer.WithNamespaceName(Hex7(clusterHash)),
)
Expand Down
7 changes: 5 additions & 2 deletions app/tracer/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ func WithStdOut(w io.Writer) func(*options) {

// WithOTLPTracer returns an option to configure an OpenTelemetry exporter for tracing
// telemetry to be sent to an OpenTelemetry Collector via gRPC.
func WithOTLPTracer(addr string, headers map[string]string) func(*options) {
func WithOTLPTracer(addr string, headers map[string]string, insecure bool) func(*options) {
return func(o *options) {
o.expFunc = func() (sdktrace.SpanExporter, error) {
opts := []otlptracegrpc.Option{
otlptracegrpc.WithInsecure(),
otlptracegrpc.WithEndpoint(addr),
}

if insecure {
opts = append(opts, otlptracegrpc.WithInsecure())
}

if len(headers) > 0 {
opts = append(opts, otlptracegrpc.WithHeaders(headers))
}
Expand Down
1 change: 1 addition & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func bindRunFlags(cmd *cobra.Command, config *app.Config) {
cmd.Flags().StringVar(&config.JaegerService, "jaeger-service", "", "[DISABLED] Service name used for jaeger tracing.")
cmd.Flags().StringVar(&config.OTLPAddress, "otlp-address", "", "Listening address for OTLP gRPC tracing backend.")
cmd.Flags().StringSliceVar(&config.OTLPHeaders, "otlp-headers", nil, "Comma separated list of headers formatted as header=value, to include in OTLP requests.")
cmd.Flags().BoolVar(&config.OTLPInsecure, "otlp-insecure", false, "Use insecure connection (no TLS) when connecting to OTLP endpoint.")
cmd.Flags().StringVar(&config.OTLPServiceName, "otlp-service-name", "charon", "Service name used for OTLP gRPC tracing.")
cmd.Flags().BoolVar(&config.SimnetBMock, "simnet-beacon-mock", false, "Enables an internal mock beacon node for running a simnet.")
cmd.Flags().BoolVar(&config.SimnetVMock, "simnet-validator-mock", false, "Enables an internal mock validator client when running a simnet. Requires simnet-beacon-mock.")
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Flags:
--no-verify Disables cluster definition and lock file verification.
--otlp-address string Listening address for OTLP gRPC tracing backend.
--otlp-headers strings Comma separated list of headers formatted as header=value, to include in OTLP requests.
--otlp-insecure Use insecure connection (no TLS) when connecting to OTLP endpoint.
--otlp-service-name string Service name used for OTLP gRPC tracing. (default "charon")
--p2p-disable-reuseport Disables TCP port reuse for outgoing libp2p connections.
--p2p-external-hostname string The DNS hostname advertised by libp2p. This may be used to advertise an external DNS.
Expand Down
Loading