public static IHttpClientBuilder AddOutgoingGoogleTraceHandler(this IHttpClientBuilder clientBuilder)
Adds an 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 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 documentation outlines the \u003ccode\u003eHttpClientBuilderExtensions\u003c/code\u003e class, which provides extension methods for \u003ccode\u003eIHttpClientBuilder\u003c/code\u003e within the \u003ccode\u003eGoogle.Cloud.Diagnostics.Common\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eHttpClientBuilderExtensions\u003c/code\u003e is 5.2.0, while the current page documents version 4.4.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddOutgoingGoogleTraceHandler\u003c/code\u003e method is available to add an \u003ccode\u003eUnchainedTraceHeaderPropagatingHandler\u003c/code\u003e to the HTTP client, which propagates trace information for outgoing requests.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAddOutgoingGoogleTraceHandler\u003c/code\u003e also has an overload that accepts a \u003ccode\u003elabelsProvider\u003c/code\u003e, allowing for custom labels to be added to outgoing traces, determined by the provided function.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHttpClientBuilderExtensions\u003c/code\u003e class inherits from \u003ccode\u003eObject\u003c/code\u003e and has inherited methods 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,[]]