add trace starts for each object type
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"go.infratographer.com/x/gidx"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"go.equinixmetal.net/infra9-metal-bridge/internal/permissions"
|
||||
@@ -13,6 +15,15 @@ import (
|
||||
// processMemberships determines the changes between what is wanted and what is live and executes on the differences.
|
||||
// If skipDeletions is true, no deletes will be executed.
|
||||
func (s *service) processMemberships(ctx context.Context, relationships Relationships, skipDeletions bool) (int, int) {
|
||||
ctx, span := tracer.Start(ctx, "processMemberships",
|
||||
trace.WithAttributes(
|
||||
attribute.String("resource.id", relationships.Resource.PrefixedID().String()),
|
||||
attribute.Int("resource.memberships", len(relationships.Memberships)),
|
||||
),
|
||||
)
|
||||
|
||||
defer span.End()
|
||||
|
||||
if len(relationships.Memberships) == 0 {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user