diff --git a/internal/nomad/api_querier.go b/internal/nomad/api_querier.go index 9f51ef3..408258e 100644 --- a/internal/nomad/api_querier.go +++ b/internal/nomad/api_querier.go @@ -181,9 +181,6 @@ func (nc *nomadAPIClient) EventStream(ctx context.Context) (<-chan *nomadApi.Eve // As Poseidon uses no such token, the request will return a permission denied error. "*", }, - nomadApi.TopicJob: {"*"}, - nomadApi.TopicNode: {"*"}, - nomadApi.TopicDeployment: {"*"}, }, 0, nc.queryOptions()) diff --git a/internal/nomad/nomad.go b/internal/nomad/nomad.go index 90c5381..9da8ec2 100644 --- a/internal/nomad/nomad.go +++ b/internal/nomad/nomad.go @@ -318,6 +318,11 @@ func handleAllocationEvent(startTime int64, allocations storage.Storage[*allocat return nil } + log.WithField("alloc_id", alloc.ID). + WithField("ClientStatus", alloc.ClientStatus). + WithField("DesiredStatus", alloc.DesiredStatus). + Debug("Handle Allocation Event") + // When starting the API and listening on the Nomad event stream we might get events that already // happened from Nomad as it seems to buffer them for a certain duration. // Ignore old events here. @@ -344,10 +349,12 @@ func handleAllocationEvent(startTime int64, allocations storage.Storage[*allocat // This allows the handling of startups and re-placements of allocations. func handlePendingAllocationEvent(alloc *nomadApi.Allocation, allocations storage.Storage[*allocationData], callbacks *AllocationProcessoring) { + log.WithField("alloc_id", alloc.ID).Debug("Handle Pending Allocation Event") if alloc.DesiredStatus == structs.AllocDesiredStatusRun { allocData, ok := allocations.Get(alloc.ID) if ok && allocData.allocClientStatus != structs.AllocClientStatusRunning { // Pending Allocation is already stored. + log.WithField("alloc_id", alloc.ID).Debug("Pending Allocation already stored") return } else if ok { // Handle Runner (/Container) re-allocations. @@ -364,6 +371,7 @@ func handlePendingAllocationEvent(alloc *nomadApi.Allocation, // handleRunningAllocationEvent calls the passed AllocationProcessor filtering similar events. func handleRunningAllocationEvent(alloc *nomadApi.Allocation, allocations storage.Storage[*allocationData], callbacks *AllocationProcessoring) { + log.WithField("alloc_id", alloc.ID).Debug("Handle Running Allocation Event") if alloc.DesiredStatus == structs.AllocDesiredStatusRun { // is first event that marks the transition between pending and running? if allocData, ok := allocations.Get(alloc.ID); ok && allocData.allocClientStatus == structs.AllocClientStatusPending {