Skip to content

Commit f49a9f6

Browse files
committed
update snippets lint
1 parent 4f3f23b commit f49a9f6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

docs/core/extensions/httpclient-latency-extensions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ For more information, see [dotnet package add](../tools/dotnet-package-add.md) o
4747

4848
To add HTTP client latency telemetry to your application, call the <xref:Microsoft.Extensions.DependencyInjection.HttpClientLatencyTelemetryExtensions.AddHttpClientLatencyTelemetry*> extension method when configuring your services:
4949

50-
:::code language="csharp" source="snippets/http/latency/Program.Extensions.cs" id="extensions":::
50+
:::code language="csharp" source="snippets/http/latency/Program.cs" id="extensions":::
5151

5252
This registration adds a `DelegatingHandler` to all HTTP clients created through <xref:System.Net.Http.IHttpClientFactory>, collecting detailed latency information for each request.
5353

@@ -57,7 +57,7 @@ You configure telemetry collection through the <xref:Microsoft.Extensions.Http.L
5757
You can supply values either with a delegate or by binding configuration (for example, `appsettings.json`).
5858
The options instance is resolved once per handler pipeline so changes apply to new clients/handlers.
5959

60-
:::code language="csharp" source="snippets/http/latency/Program.Extensions.cs" id="register-handler":::
60+
:::code language="csharp" source="snippets/http/latency/Program.cs" range="23-31":::
6161

6262
### Configuration options
6363

@@ -110,7 +110,7 @@ in the latency context and, if HTTP client log enrichment is enabled, serialized
110110
Enable enrichment at application startup by adding the logging extension (for all clients or per client) along with
111111
latency telemetry, for example:
112112

113-
:::code language="csharp" source="snippets/http/latency/Program.Extensions.cs" range="38-41":::
113+
:::code language="csharp" source="snippets/http/latency/Program.cs" range="36-39":::
114114

115115
After this, outbound requests logged through the structured logging pipeline will include the `LatencyInfo` property
116116
containing the flattened tags, checkpoints, and measures. No metrics or traces are emitted automatically for tags;
@@ -126,11 +126,11 @@ These components enable tracking and reporting the latency of HTTP client reques
126126

127127
You can register the services using the following methods:
128128

129-
:::code language="csharp" source="snippets/http/latency/Program.Extensions.cs" range="46-55":::
129+
:::code language="csharp" source="snippets/http/latency/Program.cs" range="44-53":::
130130

131131
For example:
132132

133-
:::code language="csharp" source="snippets/http/latency/Program.Extensions.cs" range="60-77":::
133+
:::code language="csharp" source="snippets/http/latency/Program.cs" range="58-75":::
134134

135135
### Platform considerations
136136

docs/core/extensions/snippets/http/latency/Program.Extensions.cs renamed to docs/core/extensions/snippets/http/latency/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.Extensions.Http.Diagnostics;
44

55

6-
internal partial class Program
6+
internal class Program
77
{
88
private static void ConfigureHttpClientLatency(HostApplicationBuilder builder)
99
{
@@ -20,7 +20,6 @@ private static void ConfigureHttpClientLatency(HostApplicationBuilder builder)
2020

2121
private static void ConfigureWithDelegate(HostApplicationBuilder builder)
2222
{
23-
// <register-handler>
2423
// Configure with delegate
2524
builder.Services.AddHttpClientLatencyTelemetry(options =>
2625
{
@@ -30,7 +29,6 @@ private static void ConfigureWithDelegate(HostApplicationBuilder builder)
3029
// Or configure from configuration
3130
builder.Services.AddHttpClientLatencyTelemetry(
3231
builder.Configuration.GetSection("HttpClientTelemetry"));
33-
// </register-handler>
3432
}
3533

3634
private static void EnableLatencyContext(HostApplicationBuilder builder)

0 commit comments

Comments
 (0)