Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/api/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (rli *RateLimitInterceptor) applyLimits(
}

if err := rli.limiter.Spend(limitType, bucket, uint16(cost), isPriority); err != nil {
rli.log.Info("rate limited",
rli.log.Debug("rate limited",
logging.String("client_ip", ip),
logging.Bool("priority", isPriority),
logging.String("method", method),
Expand Down
11 changes: 8 additions & 3 deletions pkg/api/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,21 @@ func (ti *TelemetryInterceptor) record(
logFn := ti.log.Debug

if err != nil {
logFn = ti.log.Info
fields = append(fields, zap.Error(err))
grpcErr, _ := status.FromError(err)
if grpcErr != nil {
errCode := grpcErr.Code().String()
if grpcErr.Code() == codes.ResourceExhausted ||
grpcErr.Code() == codes.InvalidArgument {
logFn = ti.log.Debug
} else {
logFn = ti.log.Error
}
fields = append(fields, []zapcore.Field{
zap.String("error_code", errCode),
zap.String("error_code", grpcErr.Code().String()),
zap.String("error_message", grpcErr.Message()),
}...)
} else {
logFn = ti.log.Error
fields = append(fields, []zapcore.Field{
zap.String("error_code", codes.Internal.String()),
zap.String("error_message", err.Error()),
Expand Down
4 changes: 2 additions & 2 deletions pkg/mls/api/v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (s *Service) SubscribeGroupMessages(
}

log := s.log.Named("subscribe-group-messages").With(zap.Int("filters", len(req.Filters)))
log.Info("subscription started")
log.Debug("subscription started")
// Send a header (any header) to fix an issue with Tonic based GRPC clients.
// See: https://github.com/xmtp/libxmtp/pull/58
_ = stream.SendHeader(metadata.Pairs("subscribed", "true"))
Expand Down Expand Up @@ -567,7 +567,7 @@ func (s *Service) SubscribeWelcomeMessages(
}

log := s.log.Named("subscribe-welcome-messages").With(zap.Int("filters", len(req.Filters)))
log.Info("subscription started")
log.Debug("subscription started")

// Send a header (any header) to fix an issue with Tonic based GRPC clients.
// See: https://github.com/xmtp/libxmtp/pull/58
Expand Down
2 changes: 1 addition & 1 deletion pkg/mls/store/backfiller_group_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (b *IsCommitBackfiller) Run() {
}

if len(ids) == 0 {
b.log.Info("No messages to classify")
b.log.Debug("No messages to classify")
foundMessages = false
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/mls/store/backfiller_installations.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (b *InstallationsBackfiller) Run() {
}

if len(installations) == 0 {
b.log.Info("No installations to backfill")
b.log.Debug("No installations to backfill")
foundMessages = false
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/mls/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ func (s *Store) PublishIdentityUpdate(
IdentityUpdateProto: protoBytes,
})

log.Info("Inserted inbox log", zap.Any("sequence_id", sequence_id))
log.Debug("Inserted inbox log", zap.Any("sequence_id", sequence_id))

if err != nil {
return err
}

for _, new_member := range state.StateDiff.NewMembers {
log.Info("New member", zap.Any("member", new_member))
log.Debug("New member", zap.Any("member", new_member))
if address, ok := new_member.Kind.(*associations.MemberIdentifier_EthereumAddress); ok {
_, err = txQueries.InsertAddressLog(ctx, queries.InsertAddressLogParams{
Address: address.EthereumAddress,
Expand Down
Loading