Skip to content

Commit

Permalink
registering tracerproviders for flyteadmin and datacatalog standalone
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw committed Nov 6, 2023
1 parent d4e91db commit 77cda4b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions datacatalog/cmd/entrypoints/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
},
}
Expand Down
9 changes: 9 additions & 0 deletions flyteadmin/cmd/entrypoints/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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)
},
}
Expand Down

0 comments on commit 77cda4b

Please sign in to comment.