diff --git a/router/batchrouter/handle_observability.go b/router/batchrouter/handle_observability.go index 3cfb161376..27e61aa751 100644 --- a/router/batchrouter/handle_observability.go +++ b/router/batchrouter/handle_observability.go @@ -188,12 +188,13 @@ func (brt *Handle) recordUploadStats(destination Connection, output UploadResult if receivedTime, err := time.Parse(misc.RFC3339Milli, output.FirstEventAt); err == nil { eventDeliveryTimeStat := stats.Default.NewTaggedStat("event_delivery_time", stats.TimerType, map[string]string{ - "module": "batch_router", - "destType": brt.destType, - "destination": destinationTag, - "workspaceId": destination.Source.WorkspaceID, - "sourceId": destination.Source.ID, - "destinationId": destination.Destination.ID, + "module": "batch_router", + "destType": brt.destType, + "destination": destinationTag, + "workspaceId": destination.Source.WorkspaceID, + "sourceId": destination.Source.ID, + "destinationId": destination.Destination.ID, + "sourceCategory": destination.Source.SourceDefinition.Category, }) eventDeliveryTimeStat.SendTiming(time.Since(receivedTime)) } diff --git a/router/types/types.go b/router/types/types.go index 02a45bc55b..f0a649b91b 100644 --- a/router/types/types.go +++ b/router/types/types.go @@ -65,6 +65,7 @@ type JobMetadataT struct { UserID string `json:"userId"` JobID int64 `json:"jobId"` SourceID string `json:"sourceId"` + SourceCategory string `json:"sourceCategory"` DestinationID string `json:"destinationId"` AttemptNum int `json:"attemptNum"` ReceivedAt string `json:"receivedAt"` diff --git a/router/worker.go b/router/worker.go index 17cea44237..a369540603 100644 --- a/router/worker.go +++ b/router/worker.go @@ -166,6 +166,7 @@ func (w *worker) workLoop() { UserID: userID, JobID: job.JobID, SourceID: parameters.SourceID, + SourceCategory: parameters.SourceCategory, DestinationID: parameters.DestinationID, AttemptNum: job.LastJobStatus.AttemptNum, ReceivedAt: parameters.ReceivedAt, @@ -1065,12 +1066,13 @@ func (w *worker) sendEventDeliveryStat(destinationJobMetadata *types.JobMetadata if err == nil { eventsDeliveryTimeStat := stats.Default.NewTaggedStat( "event_delivery_time", stats.TimerType, map[string]string{ - "module": "router", - "destType": w.rt.destType, - "destID": destination.ID, - "destination": destinationTag, - "workspaceId": status.WorkspaceId, - "sourceId": destinationJobMetadata.SourceID, + "module": "router", + "destType": w.rt.destType, + "destID": destination.ID, + "destination": destinationTag, + "workspaceId": status.WorkspaceId, + "sourceId": destinationJobMetadata.SourceID, + "sourceCategory": destinationJobMetadata.SourceCategory, }) eventsDeliveryTimeStat.SendTiming(time.Since(receivedTime))