public static class HttpClientBuilderExtensions
Extensions methods for IHttpClientBuilder.
Namespace
Google.Cloud.Diagnostics.CommonAssembly
Google.Cloud.Diagnostics.Common.dll
Methods
AddOutgoingGoogleTraceHandler(IHttpClientBuilder)
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.
Parameter | |
---|---|
Name | Description |
clientBuilder | IHttpClientBuilder The IHttpClientBuilder to add this handler to. |
Returns | |
---|---|
Type | Description |
IHttpClientBuilder |
AddOutgoingGoogleTraceHandler(IHttpClientBuilder, Func<IServiceProvider, IDictionary<String, String>>)
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.
Parameters | |
---|---|
Name | Description |
clientBuilder | IHttpClientBuilder The IHttpClientBuilder to add this handler to. |
labelsProvider | Func<IServiceProvider, IDictionary<String, String>> 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. |
Returns | |
---|---|
Type | Description |
IHttpClientBuilder |