/// <inheritdoc /> public void HandleExecution(IReceivedMessage <MessageExpression> receivedMessage, IWorkerNotification workerNotification) { var ActivityContext = receivedMessage.Headers.Extract(_tracer, _headers); using (var scope = _tracer.StartActivity("LinqExecution", ActivityKind.Internal, parentContext: ActivityContext)) { scope?.SetTag("ActionType", receivedMessage.Body.PayLoad.ToString()); _handler.HandleExecution(receivedMessage, workerNotification); } }
/// <inheritdoc /> public void HandleExecution(IReceivedMessage <MessageExpression> receivedMessage, IWorkerNotification workerNotification) { var spanContext = receivedMessage.Headers.Extract(_tracer, _headers); if (spanContext != null) { using (IScope scope = _tracer.BuildSpan("LinqExecution").AddReference(References.FollowsFrom, spanContext).StartActive(finishSpanOnDispose: true)) { scope.Span.SetTag("ActionType", receivedMessage.Body.PayLoad.ToString()); _handler.HandleExecution(receivedMessage, workerNotification); } } else { using (IScope scope = _tracer.BuildSpan("LinqExecution").StartActive(finishSpanOnDispose: true)) { scope.Span.SetTag("ActionType", receivedMessage.Body.PayLoad.ToString()); _handler.HandleExecution(receivedMessage, workerNotification); } } }
public void HandleExecution(IReceivedMessage <MessageExpression> receivedMessage, IWorkerNotification workerNotification) { switch (receivedMessage.Body.PayLoad) { case MessageExpressionPayloads.Action: case MessageExpressionPayloads.ActionRaw: using (_runMethodCompiledCodeTimer.NewContext()) { _handler.HandleExecution(receivedMessage, workerNotification); } break; case MessageExpressionPayloads.ActionText: using (_runMethodDynamicCodeTimer.NewContext()) { _handler.HandleExecution(receivedMessage, workerNotification); } break; default: throw new DotNetWorkQueueException($"Logic error - failed to handle type {receivedMessage.Body.PayLoad}"); } }