mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-29 00:47:17 +02:00
New tracing system (#5388)
* update tracing config definitions * new tracing system * performance improvements * only configure tracing in envoy if it is enabled in pomerium * [tracing] refactor to use custom extension for trace id editing (#5420) refactor to use custom extension for trace id editing * set default tracing sample rate to 1.0 * fix proxy service http middleware * improve some existing auth related traces * test fixes * bump envoyproxy/go-control-plane * code cleanup * test fixes * Fix missing spans for well-known endpoints * import extension apis from pomerium/envoy-custom
This commit is contained in:
parent
832742648d
commit
396c35b6b4
121 changed files with 6096 additions and 1946 deletions
|
@ -4,11 +4,17 @@
|
|||
package authenticateflow
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
oteltrace "go.opentelemetry.io/otel/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/stats"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/telemetry/trace"
|
||||
"github.com/pomerium/pomerium/pkg/grpc"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/user"
|
||||
"github.com/pomerium/pomerium/pkg/identity"
|
||||
|
@ -33,3 +39,23 @@ func populateUserFromClaims(u *user.User, claims map[string]any) {
|
|||
u.Claims[k] = vs
|
||||
}
|
||||
}
|
||||
|
||||
var outboundDatabrokerTraceClientOpts = []trace.ClientStatsHandlerOption{
|
||||
trace.WithStatsInterceptor(ignoreNotFoundErrors),
|
||||
}
|
||||
|
||||
func ignoreNotFoundErrors(ctx context.Context, rs stats.RPCStats) stats.RPCStats {
|
||||
if end, ok := rs.(*stats.End); ok && end.IsClient() {
|
||||
if status.Code(end.Error) == codes.NotFound {
|
||||
oteltrace.SpanFromContext(ctx).AddEvent("status code: NotFound")
|
||||
return &stats.End{
|
||||
Client: end.Client,
|
||||
BeginTime: end.BeginTime,
|
||||
EndTime: end.EndTime,
|
||||
Trailer: end.Trailer,
|
||||
Error: nil,
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue