[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."],[[["Version 4.3.1 of `GoogleTraceProvider` is now obsolete and suggests using `Google.Cloud.Diagnostics.AspNetCore.AspNetCoreTraceExtensions.TryAddGoogleTraceContextProvider` instead."],["The `GoogleTraceProvider` class, which implements `IExternalTraceProvider`, enables log entries to be associated with Google trace and span data when registered as a dependency."],["This class is specifically designed for scenarios where the Tracing component of Google.Cloud.Diagnostics is not configured, but Google traces are still being generated."],["The method `GetCurrentTraceContext(IServiceProvider)` retrieves the `TraceContextForLogEntry` for log association, or null if no trace context is present."],["The latest version is 5.2.0, and many previous versions are also available."]]],[]]