Interface IExternalTraceProvider (4.4.0)

[Obsolete("Inject a Google.Cloud.Diagnostics.Common.ITraceContext instead.")]
public interface IExternalTraceProvider

Provides external trace information to include in a log entry if there's no Google Trace available. Implement this interface when traces are being generated by your environment and sent to Google Cloud Tracing not via the Google.Cloud.Diagnostics library.

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

Methods

GetCurrentTraceContext(IServiceProvider)

TraceContextForLogEntry GetCurrentTraceContext(IServiceProvider serviceProvider)

Returns the TraceContextForLogEntry that can be associated to a log entry or null if there's currently no trace context.

Parameter
NameDescription
serviceProviderIServiceProvider

The service provider to resolve services from. Must not be null.

Returns
TypeDescription
TraceContextForLogEntry

A TraceContextForLogEntry or null if there's no current trace.