public static JaegerLog ToJaegerLog(this ActivityEvent timedEvent) { var jaegerTags = new EventTagsEnumerationState { Tags = PooledList <JaegerTag> .Create(), }; timedEvent.EnumerateTags(ref jaegerTags); // Matches what OpenTracing and OpenTelemetry defines as the event name. // https://github.com/opentracing/specification/blob/master/semantic_conventions.md#log-fields-table // https://github.com/open-telemetry/opentelemetry-specification/pull/397/files PooledList <JaegerTag> .Add(ref jaegerTags.Tags, new JaegerTag("message", JaegerTagType.STRING, vStr : timedEvent.Name)); // TODO: Use the same function as JaegerConversionExtensions or check that the perf here is acceptable. return(new JaegerLog(timedEvent.Timestamp.ToEpochMicroseconds(), jaegerTags.Tags)); }
public static JaegerLog ToJaegerLog(this ActivityEvent timedEvent) { var jaegerTags = new EventTagsEnumerationState { Tags = PooledList <JaegerTag> .Create(), }; timedEvent.EnumerateTags(ref jaegerTags); if (!jaegerTags.HasEvent) { // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/sdk_exporters/jaeger.md#events PooledList <JaegerTag> .Add(ref jaegerTags.Tags, new JaegerTag("event", JaegerTagType.STRING, vStr : timedEvent.Name)); } // TODO: Use the same function as JaegerConversionExtensions or check that the perf here is acceptable. return(new JaegerLog(timedEvent.Timestamp.ToEpochMicroseconds(), jaegerTags.Tags)); }