Google.Cloud.Diagnostics.AspNetCore3 - Class AspNetCoreGoogleDiagnosticsExtensions (5.3.0)

public static class AspNetCoreGoogleDiagnosticsExtensions

Reference documentation and code samples for the Google.Cloud.Diagnostics.AspNetCore3 class AspNetCoreGoogleDiagnosticsExtensions.

Extensions to configure Google.Cloud.Diagnostics for ASP.NET Core applications.

Inheritance

object > AspNetCoreGoogleDiagnosticsExtensions

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Methods

AddGoogleDiagnosticsForAspNetCore(IServiceCollection)

public static IServiceCollection AddGoogleDiagnosticsForAspNetCore(this IServiceCollection services)

Configures Google Diagnostics to be used in ASP.NET Core applications with default values.

Parameter
Name Description
services IServiceCollection
Returns
Type Description
IServiceCollection
Remarks

Note that the Google Cloud Project ID to use is required and it can only be obtained from the environment if running on GCP. This means that this overload can only be used when running on GCP. If you are not running on GCP or need to specify the Google Cloud Project ID, you can use any of AddGoogleDiagnosticsForAspNetCore(IServiceCollection, AspNetCoreTraceOptions, LoggingServiceOptions, ErrorReportingServiceOptions) or AddGoogleDiagnosticsForAspNetCore(IServiceCollection, string, string, string, TraceOptions, LoggingOptions, ErrorReportingOptions).

AddGoogleDiagnosticsForAspNetCore(IServiceCollection, AspNetCoreTraceOptions, LoggingServiceOptions, ErrorReportingServiceOptions)

public static IServiceCollection AddGoogleDiagnosticsForAspNetCore(this IServiceCollection services, AspNetCoreTraceOptions traceOptions = null, LoggingServiceOptions loggingOptions = null, ErrorReportingServiceOptions errorReportingOptions = null)

Configures Google Diagnostics to be used in ASP.NET Core applications.

Parameters
Name Description
services IServiceCollection
traceOptions AspNetCoreTraceOptions
loggingOptions Google.Cloud.Diagnostics.Common.LoggingServiceOptions
errorReportingOptions Google.Cloud.Diagnostics.Common.ErrorReportingServiceOptions
Returns
Type Description
IServiceCollection
Remarks

Options may be null in which case defaults will be used. Note that the Google Cloud Project ID to use is required. If not set via options, it will be obtained from the environment, but only if running on GCP.

AddGoogleDiagnosticsForAspNetCore(IServiceCollection, string, string, string, TraceOptions, LoggingOptions, ErrorReportingOptions)

public static IServiceCollection AddGoogleDiagnosticsForAspNetCore(this IServiceCollection services, string projectId = null, string serviceName = null, string serviceVersion = null, TraceOptions traceOptions = null, LoggingOptions loggingOptions = null, ErrorReportingOptions errorReportingOptions = null)

Configures Google Diagnostics to be used in ASP.NET Core applications.

Parameters
Name Description
services IServiceCollection
projectId string
serviceName string
serviceVersion string
traceOptions Google.Cloud.Diagnostics.Common.TraceOptions
loggingOptions Google.Cloud.Diagnostics.Common.LoggingOptions
errorReportingOptions Google.Cloud.Diagnostics.Common.ErrorReportingOptions
Returns
Type Description
IServiceCollection
Remarks

Options may be null in which case defaults will be used. Note that the Google Cloud Project ID to use is required. If not set via options, it will be obtained from the environment, but only if running on GCP.