public static IHttpClientBuilder AddOutgoingGoogleTraceHandler(this IHttpClientBuilder clientBuilder)
Adds an Google.Cloud.Diagnostics.Common.UnchainedTraceHeaderPropagatingHandler to the HTTP client being built,
which will propagate trace information for outgoing requests, made with this client,
when the request being handled by this server is already being traced.
public static IHttpClientBuilder AddOutgoingGoogleTraceHandler(this IHttpClientBuilder clientBuilder, Func<IServiceProvider, IDictionary<string, string>> labelsProvider)
Adds an Google.Cloud.Diagnostics.Common.UnchainedTraceHeaderPropagatingHandler to the HTTP client being built,
which will propagate trace information for outgoing requests, made with this client,
when the request being handled by this server is already being traced.
A function that provides labels that will be added to the outgoing trace.
The function will be called once per handler, on creation, and the labels obtained at that point will be
used for all subsequent requests made through this handler. Note that the scope of the
IServiceProvider argument will share the lifetime of the handler being created.
May be null, in which case no costum labels will be added to the outgoing trace.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eHttpClientBuilderExtensions\u003c/code\u003e class within the \u003ccode\u003eGoogle.Cloud.Diagnostics.Common\u003c/code\u003e namespace, detailing extension methods for \u003ccode\u003eIHttpClientBuilder\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is \u003ccode\u003e5.2.0\u003c/code\u003e, with version \u003ccode\u003e5.1.0\u003c/code\u003e detailed in this specific document, and other versions listed back to version \u003ccode\u003e4.3.1\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddOutgoingGoogleTraceHandler\u003c/code\u003e method adds an \u003ccode\u003eUnchainedTraceHeaderPropagatingHandler\u003c/code\u003e to an HTTP client, enabling trace information propagation for outgoing requests.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddOutgoingGoogleTraceHandler\u003c/code\u003e method also accepts a \u003ccode\u003elabelsProvider\u003c/code\u003e function to include custom labels in the outgoing trace.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits members from the base \u003ccode\u003eobject\u003c/code\u003e class, such as \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, \u003ccode\u003eMemberwiseClone\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]