Skip to content

Commit

Permalink
Do not export OTLP on empty endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
roeldev committed Jun 7, 2024
1 parent aefd780 commit c1be736
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (b *Builder) Global() *Builder {
}

func (b *Builder) WithDefaultExporter() *Builder {
if b.ExporterOTLP.Endpoint == "" {
return b
}

switch b.ExporterOTLP.Protocol {
case "grpc":
b.MeterProvider.WithGrpcExporter()
Expand Down

0 comments on commit c1be736

Please sign in to comment.