diff --git a/datacatalog/cmd/entrypoints/serve.go b/datacatalog/cmd/entrypoints/serve.go index 1cd7e94a72..e6d1d07160 100644 --- a/datacatalog/cmd/entrypoints/serve.go +++ b/datacatalog/cmd/entrypoints/serve.go @@ -10,6 +10,7 @@ import ( "github.com/flyteorg/flyte/datacatalog/pkg/runtime" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/otelutils" "github.com/flyteorg/flyte/flytestdlib/profutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) @@ -42,6 +43,14 @@ var serveCmd = &cobra.Command{ // Set Keys labeled.SetMetricKeys(contextutils.AppNameKey, contextutils.ProjectKey, contextutils.DomainKey) + // register otel tracer providers + for _, serviceName := range []string{otelutils.DataCatalogGormTracer, otelutils.DataCatalogServerTracer} { + if err := otelutils.RegisterTracerProvider(serviceName, otelutils.GetConfig()) ; err != nil { + logger.Errorf(ctx, "Failed to create otel tracer provider. %v", err) + return err + } + } + return datacatalogservice.ServeInsecure(ctx, cfg) }, } diff --git a/flyteadmin/cmd/entrypoints/serve.go b/flyteadmin/cmd/entrypoints/serve.go index 680795c28f..b3b575baba 100644 --- a/flyteadmin/cmd/entrypoints/serve.go +++ b/flyteadmin/cmd/entrypoints/serve.go @@ -10,6 +10,7 @@ import ( "github.com/flyteorg/flyte/flyteadmin/pkg/server" "github.com/flyteorg/flyte/flyteadmin/plugins" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/otelutils" "github.com/flyteorg/flyte/flytestdlib/profutils" ) @@ -32,6 +33,14 @@ var serveCmd = &cobra.Command{ }() server.SetMetricKeys(cfg.ApplicationConfiguration().GetTopLevelConfig()) + // register otel tracer providers + for _, serviceName := range []string{otelutils.AdminGormTracer, otelutils.AdminServerTracer} { + if err := otelutils.RegisterTracerProvider(serviceName, otelutils.GetConfig()) ; err != nil { + logger.Errorf(ctx, "Failed to create otel tracer provider. %v", err) + return err + } + } + return server.Serve(ctx, pluginRegistryStore.Load(), nil) }, }