Skip to content

Commit

Permalink
revert but keep increased time
Browse files Browse the repository at this point in the history
Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com>
  • Loading branch information
schristoff committed Sep 19, 2023
1 parent a498eb3 commit f8e9d12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion cmd/porter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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 @@ -187,7 +188,17 @@ 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)
return nil
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)
return err
},
RunE: func(cmd *cobra.Command, args []string) error {
if printVersion {
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"testing"
"time"

"get.porter.sh/porter/pkg/porter"
"get.porter.sh/porter/tests"
Expand All @@ -29,7 +30,7 @@ func TestTelemetrySetup(t *testing.T) {
defer test.RunPorter("uninstall", "otel-jaeger", "--allow-docker-host-access")

// Wait until the collection should be up
// time.Sleep(10 * time.Second)
time.Sleep(10 * time.Second)

// Try to run porter with telemetry enabled
p := porter.New()
Expand Down

0 comments on commit f8e9d12

Please sign in to comment.