Skip to content

Commit

Permalink
Revert "fixing the nesting of tracing (#2781)"
Browse files Browse the repository at this point in the history
This reverts commit 8fbff53.
  • Loading branch information
schristoff committed Sep 19, 2023
1 parent 513c0a0 commit 0114442
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cmd/porter/main.go
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
)

var includeDocsCommand = false
Expand Down Expand Up @@ -189,15 +188,7 @@ Try our QuickStart https://getporter.org/quickstart to learn how to use Porter.
// Reload configuration with the now parsed cli flags
p.DataLoader = cli.LoadHierarchicalConfig(cmd)
ctx, err := p.Connect(cmd.Context())

// Extract the parent span from the main command
parentSpan := trace.SpanFromContext(cmd.Context())

// Create a context with the main command's span
ctxWithRootCmdSpan := trace.ContextWithSpan(ctx, parentSpan)

// Set the new context to the command
cmd.SetContext(ctxWithRootCmdSpan)
cmd.SetContext(ctx)
return err
},
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit 0114442

Please sign in to comment.