diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index 2f4d0639e4d..5f39d810b80 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -18,7 +18,11 @@ dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol ## Configuration -You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: +You can configure the `OtlpExporter` through `OtlpExporterOptions` +properties and environment variables. The `OtlpExporterOptions` +setters take precedence over the environment variables. + +## Options Properties * `Endpoint`: Target to which the exporter is going to send traces or metrics. The endpoint must be a valid Uri with scheme (http or https) and host, and MAY @@ -35,6 +39,18 @@ You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: See the [`TestOtlpExporter.cs`](../../examples/Console/TestOtlpExporter.cs) for an example of how to use the exporter. +## Environment Variables + +The following environment variables can be used to override the default +values of the `OtlpExporterOptions` +(following the [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md)). + +| Environment variable | `OtlpExporterOptions` property | +| ------------------------------| -------------------------------| +| `OTEL_EXPORTER_OTLP_ENDPOINT` | `Endpoint` | +| `OTEL_EXPORTER_OTLP_HEADERS` | `Headers` | +| `OTEL_EXPORTER_OTLP_TIMEOUT` | `TimeoutMilliseconds` | + ## Special case when using insecure channel If your application is [.NET Standard