diff --git a/pkg/entity/register/worker.go b/pkg/entity/register/worker.go index 2efd1c9dc..137f68850 100644 --- a/pkg/entity/register/worker.go +++ b/pkg/entity/register/worker.go @@ -112,7 +112,14 @@ func (w *worker) send(ctx context.Context, batch map[entity.Key]fwrequest.Entity var entities []entity.Fields for _, r := range batch { - entities = append(entities, r.Data.Entity) + entity := r.Data.Entity + // Add labels to Metadata + if r.Definition.Labels != nil && len(r.Definition.Labels) > 0 { + for key, value := range r.Definition.Labels { + entity.Metadata[key] = value + } + } + entities = append(entities, entity) } responses := w.registerEntitiesWithRetry(ctx, entities)