public static class AspNetCoreTraceExtensions
Reference documentation and code samples for the Google.Cloud.Diagnostics.AspNetCore3 class AspNetCoreTraceExtensions.
Extensions for configuring Google Cloud Trace in ASP.NET Core applications.
Namespace
GoogleCloudGoogle.Cloud.DiagnosticsAspNetCore3Assembly
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 | |
---|---|
Name | Description |
services | IServiceCollection |
options | AspNetCoreTraceOptions |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
services | IServiceCollection |
Returns | |
---|---|
Type | Description |
IServiceCollection |