enhance: Change some frequency log to rated level (#29720)

This PR change some frequency log to rated level

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-01-11 16:30:50 +08:00 committed by GitHub
parent 673f980216
commit 797847904c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -929,6 +929,7 @@ func (m *MetaCache) DeprecateShardCache(database, collectionName string) {
}
func (m *MetaCache) expireShardLeaderCache(ctx context.Context) {
log := log.Ctx(ctx).WithRateGroup("proxy.expireShardLeaderCache", 1, 60)
go func() {
ticker := time.NewTicker(params.Params.ProxyCfg.ShardLeaderCacheInterval.GetAsDuration(time.Second))
defer ticker.Stop()
@ -941,7 +942,7 @@ func (m *MetaCache) expireShardLeaderCache(ctx context.Context) {
case <-ticker.C:
m.mu.RLock()
for database, db := range m.collInfo {
log.Info("expire all shard leader cache",
log.RatedInfo(10, "expire all shard leader cache",
zap.String("database", database),
zap.Strings("collections", lo.Keys(db)))
for _, info := range db {

View File

@ -171,7 +171,7 @@ func (ob *CollectionObserver) observeLoadStatus(ctx context.Context) {
}
func (ob *CollectionObserver) observePartitionLoadStatus(ctx context.Context, partition *meta.Partition, replicaNum int32) {
log := log.With(
log := log.Ctx(ctx).WithRateGroup("qcv2.observePartitionLoadStatus", 1, 60).With(
zap.Int64("collectionID", partition.GetCollectionID()),
zap.Int64("partitionID", partition.GetPartitionID()),
)
@ -185,7 +185,7 @@ func (ob *CollectionObserver) observePartitionLoadStatus(ctx context.Context, pa
return
}
log.Info("partition targets",
log.RatedInfo(10, "partition targets",
zap.Int("segmentTargetNum", len(segmentTargets)),
zap.Int("channelTargetNum", len(channelTargets)),
zap.Int("totalTargetNum", targetNum),

View File

@ -132,13 +132,14 @@ func (es *EtcdSource) UpdateOptions(opts Options) {
}
func (es *EtcdSource) refreshConfigurations() error {
log := log.Ctx(context.TODO()).WithRateGroup("config.etcdSource", 1, 60)
es.RLock()
prefix := path.Join(es.keyPrefix, "config")
es.RUnlock()
ctx, cancel := context.WithTimeout(es.ctx, ReadConfigTimeout)
defer cancel()
log.Debug("etcd refreshConfigurations", zap.String("prefix", prefix), zap.Any("endpoints", es.etcdCli.Endpoints()))
log.RatedDebug(10, "etcd refreshConfigurations", zap.String("prefix", prefix), zap.Any("endpoints", es.etcdCli.Endpoints()))
response, err := es.etcdCli.Get(ctx, prefix, clientv3.WithPrefix(), clientv3.WithSerializable())
if err != nil {
return err