Skip to content

Commit

Permalink
feat: add labels from v4 integrations config as tags on UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishuraina committed Jan 10, 2025
1 parent 8f163fa commit deb3cff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/entity/register/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
var (
wlog = log.WithComponent("RegisterWorker")
)
var (
elog = log.WithComponent("integrations.emitter.Emitter")

Check failure on line 26 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-linux / Run Linter

var `elog` is unused (unused)

Check failure on line 26 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-macos / Lint tests

var `elog` is unused (unused)

Check failure on line 26 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-windows / Lint tests

var `elog` is unused (unused)
)

// WorkerConfig will provide all configuration parameters for a register worker.
type WorkerConfig struct {
Expand Down Expand Up @@ -112,7 +115,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)

Check failure on line 125 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-linux / Run Linter

append only allowed to cuddle with appended value (wsl)

Check failure on line 125 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-macos / Lint tests

append only allowed to cuddle with appended value (wsl)

Check failure on line 125 in pkg/entity/register/worker.go

View workflow job for this annotation

GitHub Actions / linter-windows / Lint tests

append only allowed to cuddle with appended value (wsl)
}

responses := w.registerEntitiesWithRetry(ctx, entities)
Expand Down

0 comments on commit deb3cff

Please sign in to comment.