this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

don't use 'host' as structured logging field (#759)

at least in datadog, the structured logging 'host' field clobbers host
metadata for the log line.

this might not impact loko, but seems reasonable to just avoid the
naming collision generally.

authored by

bnewbold and committed by
GitHub
d8556af7 fa4ac88e

+16 -16
+1 -1
automod/rules/identity.go
··· 32 32 33 33 // new PDS host 34 34 if existingAccounts == 0 { 35 - c.Logger.Info("new PDS instance", "host", pdsHost) 35 + c.Logger.Info("new PDS instance", "pdsHost", pdsHost) 36 36 c.Increment("host", "new") 37 37 c.AddAccountFlag("host-first-account") 38 38 c.Notify("slack")
+5 -5
bgs/bgs.go
··· 800 800 case env.RepoCommit != nil: 801 801 repoCommitsReceivedCounter.WithLabelValues(host.Host).Add(1) 802 802 evt := env.RepoCommit 803 - log.Debugw("bgs got repo append event", "seq", evt.Seq, "host", host.Host, "repo", evt.Repo) 803 + log.Debugw("bgs got repo append event", "seq", evt.Seq, "pdsHost", host.Host, "repo", evt.Repo) 804 804 u, err := bgs.lookupUserByDid(ctx, evt.Repo) 805 805 if err != nil { 806 806 if !errors.Is(err, gorm.ErrRecordNotFound) { ··· 822 822 823 823 if u.TakenDown || u.UpstreamStatus == events.AccountStatusTakendown { 824 824 span.SetAttributes(attribute.Bool("taken_down_by_relay_admin", u.TakenDown)) 825 - log.Debugw("dropping commit event from taken down user", "did", evt.Repo, "seq", evt.Seq, "host", host.Host) 825 + log.Debugw("dropping commit event from taken down user", "did", evt.Repo, "seq", evt.Seq, "pdsHost", host.Host) 826 826 return nil 827 827 } 828 828 829 829 if u.UpstreamStatus == events.AccountStatusSuspended { 830 - log.Debugw("dropping commit event from suspended user", "did", evt.Repo, "seq", evt.Seq, "host", host.Host) 830 + log.Debugw("dropping commit event from suspended user", "did", evt.Repo, "seq", evt.Seq, "pdsHost", host.Host) 831 831 return nil 832 832 } 833 833 834 834 if u.UpstreamStatus == events.AccountStatusDeactivated { 835 - log.Debugw("dropping commit event from deactivated user", "did", evt.Repo, "seq", evt.Seq, "host", host.Host) 835 + log.Debugw("dropping commit event from deactivated user", "did", evt.Repo, "seq", evt.Seq, "pdsHost", host.Host) 836 836 return nil 837 837 } 838 838 ··· 891 891 } 892 892 893 893 if err := bgs.repoman.HandleExternalUserEvent(ctx, host.ID, u.ID, u.Did, evt.Since, evt.Rev, evt.Blocks, evt.Ops); err != nil { 894 - log.Warnw("failed handling event", "err", err, "host", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) 894 + log.Warnw("failed handling event", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) 895 895 896 896 if errors.Is(err, carstore.ErrRepoBaseMismatch) || ipld.IsNotFound(err) { 897 897 ai, lerr := bgs.Index.LookupUser(ctx, u.ID)
+7 -7
bgs/fedmgr.go
··· 481 481 url := fmt.Sprintf("%s://%s/xrpc/com.atproto.sync.subscribeRepos?cursor=%d", protocol, host.Host, cursor) 482 482 con, res, err := d.DialContext(ctx, url, nil) 483 483 if err != nil { 484 - log.Warnw("dialing failed", "host", host.Host, "err", err, "backoff", backoff) 484 + log.Warnw("dialing failed", "pdsHost", host.Host, "err", err, "backoff", backoff) 485 485 time.Sleep(sleepForBackoff(backoff)) 486 486 backoff++ 487 487 488 488 if backoff > 15 { 489 - log.Warnw("pds does not appear to be online, disabling for now", "host", host.Host) 489 + log.Warnw("pds does not appear to be online, disabling for now", "pdsHost", host.Host) 490 490 if err := s.db.Model(&models.PDS{}).Where("id = ?", host.ID).Update("registered", false).Error; err != nil { 491 491 log.Errorf("failed to unregister failing pds: %w", err) 492 492 } ··· 536 536 537 537 rsc := &events.RepoStreamCallbacks{ 538 538 RepoCommit: func(evt *comatproto.SyncSubscribeRepos_Commit) error { 539 - log.Debugw("got remote repo event", "host", host.Host, "repo", evt.Repo, "seq", evt.Seq) 539 + log.Debugw("got remote repo event", "pdsHost", host.Host, "repo", evt.Repo, "seq", evt.Seq) 540 540 if err := s.cb(context.TODO(), host, &events.XRPCStreamEvent{ 541 541 RepoCommit: evt, 542 542 }); err != nil { ··· 551 551 return nil 552 552 }, 553 553 RepoHandle: func(evt *comatproto.SyncSubscribeRepos_Handle) error { 554 - log.Infow("got remote handle update event", "host", host.Host, "did", evt.Did, "handle", evt.Handle) 554 + log.Infow("got remote handle update event", "pdsHost", host.Host, "did", evt.Did, "handle", evt.Handle) 555 555 if err := s.cb(context.TODO(), host, &events.XRPCStreamEvent{ 556 556 RepoHandle: evt, 557 557 }); err != nil { ··· 566 566 return nil 567 567 }, 568 568 RepoMigrate: func(evt *comatproto.SyncSubscribeRepos_Migrate) error { 569 - log.Infow("got remote repo migrate event", "host", host.Host, "did", evt.Did, "migrateTo", evt.MigrateTo) 569 + log.Infow("got remote repo migrate event", "pdsHost", host.Host, "did", evt.Did, "migrateTo", evt.MigrateTo) 570 570 if err := s.cb(context.TODO(), host, &events.XRPCStreamEvent{ 571 571 RepoMigrate: evt, 572 572 }); err != nil { ··· 581 581 return nil 582 582 }, 583 583 RepoTombstone: func(evt *comatproto.SyncSubscribeRepos_Tombstone) error { 584 - log.Infow("got remote repo tombstone event", "host", host.Host, "did", evt.Did) 584 + log.Infow("got remote repo tombstone event", "pdsHost", host.Host, "did", evt.Did) 585 585 if err := s.cb(context.TODO(), host, &events.XRPCStreamEvent{ 586 586 RepoTombstone: evt, 587 587 }); err != nil { ··· 596 596 return nil 597 597 }, 598 598 RepoInfo: func(info *comatproto.SyncSubscribeRepos_Info) error { 599 - log.Infow("info event", "name", info.Name, "message", info.Message, "host", host.Host) 599 + log.Infow("info event", "name", info.Name, "message", info.Message, "pdsHost", host.Host) 600 600 return nil 601 601 }, 602 602 RepoIdentity: func(ident *comatproto.SyncSubscribeRepos_Identity) error {
+1 -1
cmd/athome/handlers.go
··· 17 17 host = strings.SplitN(host, ":", 2)[0] 18 18 handle, err := syntax.ParseHandle(host) 19 19 if err != nil { 20 - slog.Warn("host is not a valid handle, fallback to default", "host", host) 20 + slog.Warn("host is not a valid handle, fallback to default", "hostname", host) 21 21 handle = srv.defaultHandle 22 22 } 23 23 return handle
+2 -2
cmd/hepa/server.go
··· 95 95 return nil, fmt.Errorf("ozone account DID supplied was not valid: %v", err) 96 96 } 97 97 ozoneClient.Auth.Did = od.String() 98 - logger.Info("configured ozone admin client", "did", od.String(), "host", config.OzoneHost) 98 + logger.Info("configured ozone admin client", "did", od.String(), "ozoneHost", config.OzoneHost) 99 99 } else { 100 100 logger.Info("did not configure ozone client") 101 101 } ··· 112 112 adminClient.Headers = make(map[string]string) 113 113 adminClient.Headers["x-ratelimit-bypass"] = config.RatelimitBypass 114 114 } 115 - logger.Info("configured PDS admin client", "host", config.PDSHost) 115 + logger.Info("configured PDS admin client", "pdsHost", config.PDSHost) 116 116 } else { 117 117 logger.Info("did not configure PDS admin client") 118 118 }