Skip to content

Commit

Permalink
loki: Set name and project labels if present
Browse files Browse the repository at this point in the history
Fixes #12291

Signed-off-by: Thomas Hipp <[email protected]>
  • Loading branch information
monstermunchkin committed Sep 22, 2023
1 parent 8be04fb commit 6c727f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lxd/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ func (c *Client) HandleEvent(event api.Event) {
return
}

if lifecycleEvent.Name != "" {
entry.labels["name"] = lifecycleEvent.Name
}

if lifecycleEvent.Project != "" {
entry.labels["project"] = lifecycleEvent.Project
}

// Build map. These key-value pairs will either be added as labels, or be part of the
// log message itself.
context["action"] = lifecycleEvent.Action
Expand Down

0 comments on commit 6c727f7

Please sign in to comment.