Skip to content

Commit

Permalink
fix: adjust tracing verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr committed Oct 11, 2023
1 parent e8b92c1 commit 976cd0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 9 additions & 6 deletions identity/manager.go
Expand Up @@ -415,8 +415,9 @@ func (m *Manager) UpdateTraits(ctx context.Context, id uuid.UUID, traits Traits,
}

func (m *Manager) ValidateIdentity(ctx context.Context, i *Identity, o *ManagerOptions) (err error) {
ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.validate")
defer otelx.End(span, &err)
// This trace is more noisy than it's worth in diagnostic power.
// ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.validate")
// defer otelx.End(span, &err)

if err := m.r.IdentityValidator().Validate(ctx, i); err != nil {
if _, ok := errorsx.Cause(err).(*jsonschema.ValidationError); ok && !o.ExposeValidationErrors {
Expand All @@ -429,8 +430,9 @@ func (m *Manager) ValidateIdentity(ctx context.Context, i *Identity, o *ManagerO
}

func (m *Manager) CountActiveFirstFactorCredentials(ctx context.Context, i *Identity) (count int, err error) {
ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.CountActiveFirstFactorCredentials")
defer otelx.End(span, &err)
// This trace is more noisy than it's worth in diagnostic power.
// ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.CountActiveFirstFactorCredentials")
// defer otelx.End(span, &err)

for _, strategy := range m.r.ActiveCredentialsCounterStrategies(ctx) {
current, err := strategy.CountActiveFirstFactorCredentials(i.Credentials)
Expand All @@ -444,8 +446,9 @@ func (m *Manager) CountActiveFirstFactorCredentials(ctx context.Context, i *Iden
}

func (m *Manager) CountActiveMultiFactorCredentials(ctx context.Context, i *Identity) (count int, err error) {
ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.CountActiveMultiFactorCredentials")
defer otelx.End(span, &err)
// This trace is more noisy than it's worth in diagnostic power.
// ctx, span := m.r.Tracer(ctx).Tracer().Start(ctx, "identity.Manager.CountActiveMultiFactorCredentials")
// defer otelx.End(span, &err)

for _, strategy := range m.r.ActiveCredentialsCounterStrategies(ctx) {
current, err := strategy.CountActiveMultiFactorCredentials(i.Credentials)
Expand Down
5 changes: 3 additions & 2 deletions persistence/sql/identity/persister_identity.go
Expand Up @@ -945,8 +945,9 @@ func (p *IdentityPersister) validateIdentity(ctx context.Context, i *identity.Id
}

func (p *IdentityPersister) InjectTraitsSchemaURL(ctx context.Context, i *identity.Identity) (err error) {
ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.InjectTraitsSchemaURL")
defer otelx.End(span, &err)
// This trace is more noisy than it's worth in diagnostic power.
// ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.InjectTraitsSchemaURL")
// defer otelx.End(span, &err)

ss, err := p.r.IdentityTraitsSchemas(ctx)
if err != nil {
Expand Down

0 comments on commit 976cd0d

Please sign in to comment.