Skip to content

Commit 88b6b0e

Browse files
authored
Improve OTLP Exporter doc - provide recommendation on custom AuthN (#5380)
1 parent 09dd46f commit 88b6b0e

File tree

1 file changed

+11
-2
lines changed
  • src/OpenTelemetry.Exporter.OpenTelemetryProtocol

1 file changed

+11
-2
lines changed

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ services.AddOpenTelemetry()
350350
}));
351351
```
352352

353+
> [!NOTE]
354+
> `DefaultRequestHeaders` can be used for [HTTP Basic Access
355+
Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). For
356+
more complex authentication requirements,
357+
[`System.Net.Http.DelegatingHandler`](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler)
358+
can be used to handle token refresh, as explained
359+
[here](https://stackoverflow.com/questions/56204350/how-to-refresh-a-token-using-ihttpclientfactory).
360+
353361
For users using
354362
[IHttpClientFactory](https://docs.microsoft.com/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests)
355363
you may also customize the named "OtlpTraceExporter" and/or "OtlpMetricExporter"
@@ -362,8 +370,9 @@ services.AddHttpClient(
362370
client.DefaultRequestHeaders.Add("X-MyCustomHeader", "value"));
363371
```
364372

365-
Note: The single instance returned by `HttpClientFactory` is reused by all
366-
export requests.
373+
> [!NOTE]
374+
> The single instance returned by `HttpClientFactory` is reused by all export
375+
requests.
367376

368377
## Troubleshooting
369378

0 commit comments

Comments
 (0)