<PackageReference Include="OpenTelemetry.Api" Version="1.13.0" />

OpenTelemetry.Trace.Tracer

public class Tracer
Tracer is the class responsible for creating TelemetrySpan.
public static TelemetrySpan CurrentSpan { get; }

Gets the current span from the context.

public static TelemetrySpan WithSpan(TelemetrySpan span)

Sets the given span as the current one in the context.

public TelemetrySpan StartActiveSpan(string name, SpanKind kind, ref TelemetrySpan parentSpan, SpanAttributes initialAttributes = null, IEnumerable<Link> links = null, DateTimeOffset startTime = default)

Starts a span and make it the current active span.

public TelemetrySpan StartActiveSpan(string name, SpanKind kind = 1, ref SpanContext parentContext = null, SpanAttributes initialAttributes = null, IEnumerable<Link> links = null, DateTimeOffset startTime = default)

Starts a span and make it the current active span.

public TelemetrySpan StartRootSpan(string name, SpanKind kind = 1, SpanAttributes initialAttributes = null, IEnumerable<Link> links = null, DateTimeOffset startTime = default)

Starts root span.

public TelemetrySpan StartSpan(string name, SpanKind kind, ref TelemetrySpan parentSpan, SpanAttributes initialAttributes = null, IEnumerable<Link> links = null, DateTimeOffset startTime = default)

Starts a span and does not make it as current span.

public TelemetrySpan StartSpan(string name, SpanKind kind = 1, ref SpanContext parentContext = null, SpanAttributes initialAttributes = null, IEnumerable<Link> links = null, DateTimeOffset startTime = default)

Starts a span and does not make it as current span.