public static void WritePublishMessageStoreAfter(this DiagnosticListener @this,
                                                  Guid operationId,
                                                  CSRedisPublishedMessage message,
                                                  [CallerMemberName] string operation = "")
 {
     if (@this.IsEnabled(CSRedisAfterPublishMessageStore))
     {
         @this.Write(CSRedisAfterPublishMessageStore, new
         {
             OperationId    = operationId,
             Operation      = operation,
             MessageId      = message.Id,
             MessageName    = message.Name,
             MessageContent = message.Content,
             Timestamp      = Stopwatch.GetTimestamp()
         });
     }
 }
        public static Guid WritePublishMessageStoreBefore(this DiagnosticListener @this,
                                                          CSRedisPublishedMessage message,
                                                          [CallerMemberName] string operation = "")
        {
            if (@this.IsEnabled(CSRedisBeforePublishMessageStore))
            {
                var operationId = Guid.NewGuid();
                BrokerPublishEventData eventData = new BrokerPublishEventData(new Guid(), "", "", "", "", DateTime.Now);
                eventData.Headers = new TracingHeaders();
                @this.Write(CSRedisBeforePublishMessageStore, eventData);
                //@this.Write(CSRedisBeforePublishMessageStore, new
                //{
                //    OperationId = operationId,
                //    Operation = operation,
                //    MessageName = message.Name,
                //    MessageContent = message.Content
                //});

                return(operationId);
            }

            return(Guid.Empty);
        }