protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Inputs var fileName = FileName.Get(context); var jsonConfiguration = JsonConfiguration.Get(context); var apiKey = APIKey.Get(context); var extractorHelper = new ExtractorHelper(); var dtResult = extractorHelper.DoExtraction(apiKey, fileName, jsonConfiguration); // Outputs return((ctx) => { Results.Set(ctx, dtResult); }); }
public ITraceContext Extract(C carrier) { var extracted = _singleExtractor.Extract(carrier); if (extracted != null) { return(extracted); } return(ExtractorHelper.TryParseTrace( _getter(carrier, _b3Propagation.TraceIdKey), _getter(carrier, _b3Propagation.SpanIdKey), _getter(carrier, _b3Propagation.ParentSpanIdKey), _getter(carrier, _b3Propagation.SampledKey), _getter(carrier, _b3Propagation.DebugKey) )); }
public ConsumerTrace(string serviceName, string rpc, string encodedTraceId, string encodedSpanId, string encodedParentSpanId, string sampledStr, string flagsStr) { var spanState = ExtractorHelper.TryParseTrace(encodedTraceId, encodedSpanId, encodedParentSpanId, sampledStr, flagsStr); if (spanState != default(SpanState)) { Trace = Trace.CreateFromId(spanState).Child(); } else { Trace = Trace.Create(); } Trace.Current = Trace; Trace.Record(Annotations.ConsumerStart()); Trace.Record(Annotations.ServiceName(serviceName)); Trace.Record(Annotations.Rpc(rpc)); }
public static bool TryParseTrace(string encodedTraceId, string encodedSpanId, string encodedParentSpanId, string sampledStr, string flagsStr, out Trace trace) { var traceContext = ExtractorHelper.TryParseTrace(encodedTraceId, encodedSpanId, encodedParentSpanId, sampledStr, flagsStr); return(TryCreateTraceFromTraceContext(traceContext, out trace)); }