Class AspNetCoreTraceExtensions

public static class AspNetCoreTraceExtensions

Extensions for configuring Google Cloud Trace in ASP.NET Core applications.

Inheritance

Object > AspNetCoreTraceExtensions

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Methods

AddGoogleTraceForAspNetCore(IServiceCollection, AspNetCoreTraceOptions)

public static IServiceCollection AddGoogleTraceForAspNetCore(this IServiceCollection services, AspNetCoreTraceOptions options = null)

Configures Google Cloud Tracing for ASP .NET Core applications./>.

Parameters
NameDescription
servicesIServiceCollection
optionsAspNetCoreTraceOptions
Returns
TypeDescription
IServiceCollection

TryAddGoogleTraceContextProvider(IServiceCollection)

public static IServiceCollection TryAddGoogleTraceContextProvider(this IServiceCollection services)

Adds the services needed for obtaining the trace context from Google's own trace header, but only if no other trace context provider is registered. If you are using AddGoogleTraceForAspNetCore(IServiceCollection, AspNetCoreTraceOptions) you don't need to call this method. Only use this method if you want to extract the trace context information from Google's own header for your own code to use, or if you are not using the tracing component of this library but are using the logging component and want the trace context information to be associated with the log entries.

Parameter
NameDescription
servicesIServiceCollection
Returns
TypeDescription
IServiceCollection