Exemple #1
0
        public void CapBeforeConsume([Object] CapEventDataSubStore eventData)
        {
            var carrierHeader = new CapCarrierHeaderCollection(eventData.TransportMessage);
            var context       = _tracingContext.CreateEntrySegmentContext(OperateNamePrefix + eventData.Operation + ConsumerOperateNameSuffix, carrierHeader);

            context.Span.SpanLayer = SpanLayer.MQ;
            context.Span.Component = GetComponent(eventData.BrokerAddress, false);
            context.Span.Peer      = eventData.BrokerAddress.Endpoint;
            context.Span.AddTag(Tags.MQ_TOPIC, eventData.Operation);
            context.Span.AddTag(Tags.MQ_BROKER, eventData.BrokerAddress.Endpoint);
            context.Span.AddLog(LogEvent.Event("Event Persistence"));
            context.Span.AddLog(LogEvent.Message("CAP message persistence start..."));

            _contexts[eventData.TransportMessage.GetId()] = _entrySegmentContextAccessor.Context;
        }
        public void CapBeforeConsume([Object] CapEventDataSubStore eventData)
        {
            var carrierHeader = new CapCarrierHeaderCollection(eventData.TransportMessage);
            var eventName     = eventData.TransportMessage.GetGroup() + "/" + eventData.Operation;
            var operationName = OperateNamePrefix + eventName + ConsumerOperateNameSuffix;
            var context       = _tracingContext.CreateEntrySegmentContext(operationName, carrierHeader);

            context.Span.SpanLayer = SpanLayer.DB;
            context.Span.Component = GetComponent(eventData.BrokerAddress, false);
            context.Span.Peer      = eventData.BrokerAddress.Endpoint.Replace("-1", "5672");
            context.Span.AddTag(Tags.MQ_TOPIC, eventData.Operation);
            context.Span.AddTag(Tags.MQ_BROKER, eventData.BrokerAddress.Endpoint);
            context.Span.AddLog(LogEvent.Event("Event Persistence Start"));
            context.Span.AddLog(LogEvent.Message("CAP message persistence start..."));

            _contexts[eventData.TransportMessage.GetId() + eventData.TransportMessage.GetGroup()] = context;
        }