Skip to content

Commit

Permalink
debug sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff committed Nov 25, 2024
1 parent dda74cd commit 2ca48b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cas/sectigocas/sectigocas.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/smallstep/certificates/acme"
"github.com/smallstep/certificates/acme/api"
"github.com/smallstep/certificates/authority/provisioner"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"

pb "github.com/hm-edu/portal-apis"
"github.com/pkg/errors"
Expand Down Expand Up @@ -64,6 +63,8 @@ func sentryInterceptor(ctx context.Context,
sentry.SentryBaggageHeader, span.ToBaggage(),
)
}

logrus.Infof("Starting span for method %s", method)
ctx = metadata.NewOutgoingContext(ctx, md)
defer span.Finish()

Expand All @@ -86,7 +87,7 @@ func New(ctx context.Context, opts apiv1.Options) (*SectigoCAS, error) {
conn, err := grpc.NewClient(
config.PKIBackend,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()), grpc.WithUnaryInterceptor(sentryInterceptor),
grpc.WithUnaryInterceptor(sentryInterceptor),
)
if err != nil {
return nil, err
Expand All @@ -95,7 +96,7 @@ func New(ctx context.Context, opts apiv1.Options) (*SectigoCAS, error) {
conn, err = grpc.NewClient(
config.EABBackend,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()), grpc.WithUnaryInterceptor(sentryInterceptor),
grpc.WithUnaryInterceptor(sentryInterceptor),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2ca48b5

Please sign in to comment.