[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 latest version of `GoogleTraceProvider` is 5.2.0, and it allows Log Entries to be associated with Google traces and spans when registered as a dependency."],["`GoogleTraceProvider` is now obsolete, recommending the use of `Google.Cloud.Diagnostics.AspNetCore.AspNetCoreTraceExtensions.TryAddGoogleTraceContextProvider` instead."],["It implements `IExternalTraceProvider` and inherits from `Object`, with various inherited members including `GetHashCode`, `GetType`, `MemberwiseClone`, and `ToString`."],["This provider is intended for use when the Tracing component of the Google Cloud Diagnostics library is not configured, but Google traces are being generated, like when the application is in Google Cloud."],["The `GetCurrentTraceContext` method allows retrieval of the `TraceContextForLogEntry` associated with a log entry, or returns null if there is no current trace, requiring an `IServiceProvider` parameter."]]],[]]