[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreTraceExtensions.TryAddGoogleTraceContextProvider instead.")]public class GoogleTraceProvider:IExternalTraceProvider
If this is registered as a dependency, then Log Entries will be associated with
the Google trace and span.
To be used when the Tracing component of the Google.Cloud.Diagnostics libraries
is not configured, but Google traces are still being generated, for instance,
because the application is being run in Google Cloud.
If the Tracing component is configured, log entries are automatically associated
to Google traces and spans.
Methods
GetCurrentTraceContext(IServiceProvider)
public TraceContextForLogEntry GetCurrentTraceContext(IServiceProvider serviceProvider)
Returns the TraceContextForLogEntry that can be associated to a log entry or
null if there's currently no trace context.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["The `GoogleTraceProvider` class, part of the `Google.Cloud.Diagnostics.AspNetCore3` namespace, is used to associate log entries with Google traces and spans when the Tracing component is not configured, particularly in Google Cloud environments."],["Version 4.4.0 of `GoogleTraceProvider` is currently available and earlier versions include 5.2.0, 5.1.0, 5.0.0, and 4.3.1."],["`GoogleTraceProvider` implements the `IExternalTraceProvider` interface, and the class is now considered obsolete, with users being encouraged to use `Google.Cloud.Diagnostics.AspNetCore.AspNetCoreTraceExtensions.TryAddGoogleTraceContextProvider` instead."],["The `GetCurrentTraceContext` method allows retrieval of the `TraceContextForLogEntry`, which is either the current trace context to be associated with a log entry or null if there is no present trace context."],["If registered as a dependency, Log Entries will be associated with the Google trace and span."]]],[]]