diff --git a/pkg/applicationserver/observability.go b/pkg/applicationserver/observability.go index 90a8a0fcc8..9eb9a2e032 100644 --- a/pkg/applicationserver/observability.go +++ b/pkg/applicationserver/observability.go @@ -101,6 +101,36 @@ var ( events.WithDataType(&ttnpb.ApplicationUp{}), events.WithPropagateToParent(), ) + evtDownlinkQueueInvalidated = events.Define( + "as.up.downlink.queue.invalidated", "downlink queue invalidated", + events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), + events.WithDataType(&ttnpb.ApplicationUp{}), + events.WithPropagateToParent(), + ) + evtDownlinkFailed = events.Define( + "as.up.downlink.failed", "downlink failed", + events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), + events.WithDataType(&ttnpb.ApplicationUp{}), + events.WithPropagateToParent(), + ) + evtDownlinkSent = events.Define( + "as.up.downlink.sent", "downlink sent", + events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), + events.WithDataType(&ttnpb.ApplicationUp{}), + events.WithPropagateToParent(), + ) + evtDownlinkAck = events.Define( + "as.up.downlink.ack", "downlink acknowledged", + events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), + events.WithDataType(&ttnpb.ApplicationUp{}), + events.WithPropagateToParent(), + ) + evtDownlinkNack = events.Define( + "as.up.downlink.nack", "downlink not acknowledged", + events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), + events.WithDataType(&ttnpb.ApplicationUp{}), + events.WithPropagateToParent(), + ) evtReceiveDataDown = events.Define( "as.down.data.receive", "receive downlink data message", events.WithVisibility(ttnpb.Right_RIGHT_APPLICATION_TRAFFIC_READ), @@ -283,6 +313,16 @@ func registerForwardUp(ctx context.Context, msg *ttnpb.ApplicationUp) { events.Publish(evtForwardLocationSolved.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) case *ttnpb.ApplicationUp_ServiceData: events.Publish(evtForwardServiceData.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) + case *ttnpb.ApplicationUp_DownlinkQueueInvalidated: + events.Publish(evtDownlinkQueueInvalidated.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) + case *ttnpb.ApplicationUp_DownlinkFailed: + events.Publish(evtDownlinkFailed.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) + case *ttnpb.ApplicationUp_DownlinkSent: + events.Publish(evtDownlinkSent.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) + case *ttnpb.ApplicationUp_DownlinkAck: + events.Publish(evtDownlinkAck.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) + case *ttnpb.ApplicationUp_DownlinkNack: + events.Publish(evtDownlinkNack.NewWithIdentifiersAndData(ctx, msg.EndDeviceIds, msg)) default: return }