Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
lowercase initTracerProvider method + remove uneeded import
Browse files Browse the repository at this point in the history
Signed-off-by: Melchior Moulin <[email protected]>
  • Loading branch information
melchiormoulin committed Jun 28, 2022
1 parent 0d68765 commit 81abf42
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/strimzi/strimzi-canary/internal/servers"
"github.com/strimzi/strimzi-canary/internal/services"
"github.com/strimzi/strimzi-canary/internal/workers"
_ "go.opentelemetry.io/otel/exporters/jaeger"
)

var (
Expand All @@ -46,7 +45,7 @@ var (

var saramaLogger = log.New(io.Discard, "[Sarama] ", log.LstdFlags)

func InitTracerProvider(ActivateTracing bool, JaegerExporterTracing bool, OtlpExporterTracing bool) *sdktrace.TracerProvider {
func initTracerProvider(ActivateTracing bool, JaegerExporterTracing bool, OtlpExporterTracing bool) *sdktrace.TracerProvider {
resources, _ := resource.New(context.Background(),
resource.WithFromEnv(), // pull attributes from OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME environment variables
resource.WithProcess(), // This option configures a set of Detectors that discover process information
Expand Down Expand Up @@ -93,7 +92,7 @@ func main() {

glog.Infof("Starting Strimzi canary tool [%s] with config: %+v", version, canaryConfig)

tp := InitTracerProvider(canaryConfig.ActivateTracing, canaryConfig.JaegerExporterTracing, canaryConfig.OtlpExporterTracing)
tp := initTracerProvider(canaryConfig.ActivateTracing, canaryConfig.JaegerExporterTracing, canaryConfig.OtlpExporterTracing)
defer func() {
if tp != nil {
if err := tp.Shutdown(context.Background()); err != nil {
Expand Down Expand Up @@ -192,7 +191,7 @@ func applyDynamicConfig(dynamicCanaryConfig *config.DynamicCanaryConfig) {
} else {
saramaLogger.SetOutput(io.Discard)
}
InitTracerProvider(*dynamicCanaryConfig.ActivateTracing, *dynamicCanaryConfig.JaegerExporterTracing, *dynamicCanaryConfig.OtlpExporterTracing)
initTracerProvider(*dynamicCanaryConfig.ActivateTracing, *dynamicCanaryConfig.JaegerExporterTracing, *dynamicCanaryConfig.OtlpExporterTracing)

glog.Warningf("Applied dynamic config %s", dynamicCanaryConfig)
}

0 comments on commit 81abf42

Please sign in to comment.