add trace starts for each object type
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
|
||||
"go.infratographer.com/x/events"
|
||||
"go.infratographer.com/x/gidx"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"go.equinixmetal.net/infra9-metal-bridge/internal/permissions"
|
||||
)
|
||||
@@ -13,6 +15,15 @@ import (
|
||||
// Relationship creations use events.
|
||||
// Relationship deletions use the api, as delete events delete all related resources and not just the provided ones.
|
||||
func (s *service) processRelationships(ctx context.Context, eventType string, relationships Relationships) int {
|
||||
ctx, span := tracer.Start(ctx, "processRelationships",
|
||||
trace.WithAttributes(
|
||||
attribute.String("resource.id", relationships.Resource.PrefixedID().String()),
|
||||
attribute.Int("resource.subject_relationships", len(relationships.SubjectRelationships)),
|
||||
),
|
||||
)
|
||||
|
||||
defer span.End()
|
||||
|
||||
rlogger := s.logger.With("resource.id", relationships.Resource.PrefixedID())
|
||||
|
||||
wantParentRelationship, wantSubjectRelationships := s.mapRelationWants(relationships)
|
||||
|
||||
Reference in New Issue
Block a user