Unified Storage: Add traces to poller (#95369)

add traces to poller
This commit is contained in:
owensmallwood 2024-10-24 13:49:38 -06:00 committed by GitHub
parent 2deced7d40
commit ecebaf1bdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -531,6 +531,7 @@ func (b *backend) poller(ctx context.Context, since groupResourceRV, stream chan
case <-b.done:
return
case <-t.C:
ctx, span := b.tracer.Start(ctx, tracePrefix+"poller")
// List the latest RVs
grv, err := b.listLatestRVs(ctx)
if err != nil {
@ -562,12 +563,15 @@ func (b *backend) poller(ctx context.Context, since groupResourceRV, stream chan
}
t.Reset(b.pollingInterval)
span.End()
}
}
}
// listLatestRVs returns the latest resource version for each (Group, Resource) pair.
func (b *backend) listLatestRVs(ctx context.Context) (groupResourceRV, error) {
ctx, span := b.tracer.Start(ctx, tracePrefix+"listLatestRVs")
defer span.End()
var grvs []*groupResourceVersion
err := b.db.WithTx(ctx, ReadCommittedRO, func(ctx context.Context, tx db.Tx) error {
var err error