Google.Cloud.Diagnostics.Common - Class GoogleDiagnosticsExtensions (5.1.0)

public static class GoogleDiagnosticsExtensions

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class GoogleDiagnosticsExtensions.

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

Inheritance

object > GoogleDiagnosticsExtensions

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

AddGoogleDiagnostics(IServiceCollection)

public static IServiceCollection AddGoogleDiagnostics(this IServiceCollection services)

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

Parameter
NameDescription
servicesIServiceCollection
Returns
TypeDescription
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 AddGoogleDiagnostics(IServiceCollection, TraceServiceOptions, LoggingServiceOptions, ErrorReportingServiceOptions) or AddGoogleDiagnostics(IServiceCollection, string, string, string, TraceOptions, LoggingOptions, ErrorReportingOptions).

AddGoogleDiagnostics(IServiceCollection, TraceServiceOptions, LoggingServiceOptions, ErrorReportingServiceOptions)

public static IServiceCollection AddGoogleDiagnostics(this IServiceCollection services, TraceServiceOptions traceOptions = null, LoggingServiceOptions loggingOptions = null, ErrorReportingServiceOptions errorReportingOptions = null)

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

Parameters
NameDescription
servicesIServiceCollection
traceOptionsTraceServiceOptions
loggingOptionsLoggingServiceOptions
errorReportingOptionsErrorReportingServiceOptions
Returns
TypeDescription
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.

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

public static IServiceCollection AddGoogleDiagnostics(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 non ASP.NET Core applications.

Parameters
NameDescription
servicesIServiceCollection
projectIdstring
serviceNamestring
serviceVersionstring
traceOptionsTraceOptions
loggingOptionsLoggingOptions
errorReportingOptionsErrorReportingOptions
Returns
TypeDescription
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.