new tracing system

This commit is contained in:
Joe Kralicky 2025-01-03 19:45:53 +00:00
parent 8f36870650
commit b9065b6a55
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
130 changed files with 7928 additions and 1836 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"time"
"github.com/pomerium/pomerium/internal/telemetry/trace"
"github.com/pomerium/pomerium/internal/testenv"
"github.com/pomerium/pomerium/pkg/grpcutil"
"google.golang.org/grpc"
@ -12,6 +13,11 @@ import (
)
func WaitStartupComplete(env testenv.Environment, timeout ...time.Duration) time.Duration {
if env.GetState() == testenv.NotRunning {
panic("test bug: WaitStartupComplete called before starting the test environment")
}
_, span := trace.Continue(env.Context(), "snippets.WaitStartupComplete")
defer span.End()
start := time.Now()
recorder := env.NewLogRecorder()
if len(timeout) == 0 {
@ -31,5 +37,6 @@ func WaitStartupComplete(env testenv.Environment, timeout ...time.Duration) time
)
env.Require().NoError(err)
env.Require().True(cc.WaitForStateChange(ctx, connectivity.Ready))
cc.Close()
return time.Since(start)
}