logging and otel

This commit is contained in:
Tim Möhlmann
2023-11-05 13:58:22 +02:00
parent 66f91cdc4e
commit 96a53aa130
6 changed files with 116 additions and 65 deletions

View File

@@ -6,9 +6,11 @@ import (
_ "embed"
"github.com/jackc/pgtype"
"github.com/zitadel/zitadel/internal/api/authz"
"github.com/zitadel/zitadel/internal/crypto"
"github.com/zitadel/zitadel/internal/database"
"github.com/zitadel/zitadel/internal/telemetry/tracing"
)
type IntrospectionClient struct {
@@ -22,6 +24,9 @@ type IntrospectionClient struct {
var introspectionClientByIDQuery string
func (q *Queries) GetIntrospectionClientByID(ctx context.Context, clientID string, getKeys bool) (_ *IntrospectionClient, err error) {
ctx, span := tracing.NewSpan(ctx)
defer func() { span.EndWithError(err) }()
var (
instanceID = authz.GetInstance(ctx).InstanceID()
client = new(IntrospectionClient)

View File

@@ -396,6 +396,9 @@ func (wm *PublicKeyReadModel) Query() *eventstore.SearchQueryBuilder {
}
func (q *Queries) GetActivePublicKeyByID(ctx context.Context, keyID string, current time.Time) (_ PublicKey, err error) {
ctx, span := tracing.NewSpan(ctx)
defer func() { span.EndWithError(err) }()
model := NewPublicKeyReadModel(keyID, authz.GetInstance(ctx).InstanceID())
if err := q.eventstore.FilterToQueryReducer(ctx, model); err != nil {
return nil, err