From 7a075836d096422e94513210290c69156d4096a7 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 13:47:59 +0200 Subject: [PATCH 1/6] Add documentation on env variables configuration --- src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index 2f4d0639e4d..595802a0e91 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -32,6 +32,11 @@ You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: * `BatchExportProcessorOptions`: Configuration options for the batch exporter. Only used if ExportProcessorType is set to Batch. +Some of these can also be set by environment variables following [documentation](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). For now we support following variables: +* `OTEL_EXPORTER_OTLP_ENDPOINT` +* `OTEL_EXPORTER_OTLP_HEADERS` +* `OTEL_EXPORTER_OTLP_TIMEOUT` + See the [`TestOtlpExporter.cs`](../../examples/Console/TestOtlpExporter.cs) for an example of how to use the exporter. From 5bdebf90039d09dbc5efd5073441b9172f247e58 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 13:50:31 +0200 Subject: [PATCH 2/6] Fix wording --- src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index 595802a0e91..3c1af73941f 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -32,7 +32,7 @@ You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: * `BatchExportProcessorOptions`: Configuration options for the batch exporter. Only used if ExportProcessorType is set to Batch. -Some of these can also be set by environment variables following [documentation](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). For now we support following variables: +Some of these can also be set by environment variables following [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). For now we support following variables: * `OTEL_EXPORTER_OTLP_ENDPOINT` * `OTEL_EXPORTER_OTLP_HEADERS` * `OTEL_EXPORTER_OTLP_TIMEOUT` From 7adc5197d51100675b3aa088bc6f1d93d7eb440f Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 14:31:24 +0200 Subject: [PATCH 3/6] Add blank line for formatting conventions --- src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index 3c1af73941f..aa3c21c61be 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -33,6 +33,7 @@ You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: Only used if ExportProcessorType is set to Batch. Some of these can also be set by environment variables following [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). For now we support following variables: + * `OTEL_EXPORTER_OTLP_ENDPOINT` * `OTEL_EXPORTER_OTLP_HEADERS` * `OTEL_EXPORTER_OTLP_TIMEOUT` From 604b55761376e05983bbc527d07c2c0898a36489 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 14:39:19 +0200 Subject: [PATCH 4/6] Format documentation to match the Jaeger one --- .../README.md | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index aa3c21c61be..9545cb11259 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -18,7 +18,9 @@ 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 @@ -32,15 +34,20 @@ You can configure the `OtlpExporter` through `OtlpExporterOptions` properties: * `BatchExportProcessorOptions`: Configuration options for the batch exporter. Only used if ExportProcessorType is set to Batch. -Some of these can also be set by environment variables following [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). For now we support following variables: - -* `OTEL_EXPORTER_OTLP_ENDPOINT` -* `OTEL_EXPORTER_OTLP_HEADERS` -* `OTEL_EXPORTER_OTLP_TIMEOUT` - 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` (See [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 From 72f43e789f298a0156eb5d825fb7f4692d614570 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 15:14:19 +0200 Subject: [PATCH 5/6] Rename the specification reference --- src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index 9545cb11259..ba8ed8c046b 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -40,7 +40,7 @@ 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` (See [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md)). +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 | | ------------------------------| -------------------------------| From 1a8fff39d970cde84a27acbc7c0d78eeb1ff632f Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Jul 2021 15:17:49 +0200 Subject: [PATCH 6/6] Add line breaks --- src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md index ba8ed8c046b..5f39d810b80 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md @@ -18,7 +18,9 @@ dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol ## Configuration -You can configure the `OtlpExporter` through `OtlpExporterOptions` properties and environment variables. The `OtlpExporterOptions` setters take precedence over the environment variables. +You can configure the `OtlpExporter` through `OtlpExporterOptions` +properties and environment variables. The `OtlpExporterOptions` +setters take precedence over the environment variables. ## Options Properties @@ -40,7 +42,8 @@ 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)). +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 | | ------------------------------| -------------------------------|