[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreTraceExtensions instead.")]
public static class CloudTraceExtension
Uses the Google Cloud Trace Middleware. Traces the time taken for all subsequent delegates to run. The time taken and metadata will be sent to the Google Cloud Trace API. Also allows for more finely grained manual tracing.
Namespace
Google.Cloud.Diagnostics.AspNetCore3Assembly
Google.Cloud.Diagnostics.AspNetCore3.dll
Remarks
Traces requests and reports them to Google Cloud Trace. Docs: https://cloud.google.com/trace/docs/
Methods
AddGoogleTrace(IServiceCollection, Action<TraceServiceOptions>)
[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreTraceExtensions.AddGoogleTraceForAspNetCore instead.")]
public static IServiceCollection AddGoogleTrace(this IServiceCollection services, Action<TraceServiceOptions> setupAction)
Adds the needed services for Google Cloud Tracing. Used with UseGoogleTrace(IApplicationBuilder).
Parameters | |
---|---|
Name | Description |
services | IServiceCollection The service collection. Must not be null. |
setupAction | Action<TraceServiceOptions> Action to set up options. Must not be null. |
Returns | |
---|---|
Type | Description |
IServiceCollection |
If ExceptionHandling is set to Propagate and the RequestDelegate executed by this middleware throws ad exception and this diagnostics library also throws an exception trying to report it and AggregateException with both exceptions will be thrown. Otherwise only the exception from the RequestDelegate will be thrown.
UseGoogleTrace(IApplicationBuilder)
[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreTraceExtensions.AddGoogleTraceForAspNetCorefor configuring Google Cloud Trace in ASP.NET Core applications. There's no need to explicitly register the middleware.")]
public static IApplicationBuilder UseGoogleTrace(this IApplicationBuilder app)
Uses middleware that will trace time taken for all subsequent delegates to run. The time taken and metadata will be sent to the Google Cloud Trace API. To be used with AddGoogleTrace(IServiceCollection, Action<TraceServiceOptions>),
Parameter | |
---|---|
Name | Description |
app | IApplicationBuilder |
Returns | |
---|---|
Type | Description |
IApplicationBuilder |