From c7277469fc17e9f49948c3072e05332dcbc6a5fa Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:04:07 -0500 Subject: [PATCH 1/9] Adds a readme to the otlpmetrics exporter. --- exporters/otlp/otlpmetric/readme.md | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 exporters/otlp/otlpmetric/readme.md diff --git a/exporters/otlp/otlpmetric/readme.md b/exporters/otlp/otlpmetric/readme.md new file mode 100644 index 00000000000..0a189c71b4d --- /dev/null +++ b/exporters/otlp/otlpmetric/readme.md @@ -0,0 +1,61 @@ +# OpenTelemetry-Go OTLP Metric Exporter + +[![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric) + +[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. + +## Installation + +``` +go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc +``` + +or + +``` +go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp +``` + +## Examples + +- [HTTP Exporter setup and examples](./otlpmetrichttp/example_test.go) +- [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector) + +## [`otlpmetric`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric) + +The `otlptrace` package provides common functions used within the [otlpmetricgrpc](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) and [otlpmetrichttp](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) packages. + +Exporters should be created using the New functions from the respective packages. + +## Configuration + +### Environment Variables + +The following environment variables can be used (instead of options objects) to override the default configuration. +For more information about how each of these environment variables is interpreted, see [the OpenTelemetry +specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). + +Note: all names are prefixed with `OTEL_EXPORTER_OTLP_` and are uppercased. + +| Name | Description | Default | Override with | +|------|-------------|---------|---------------| +| `ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `INSECURE` to true |`http://localhost:4317`| `METRICS_ENDPOINT`, [WithEndpoint()] | +| `METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | +| `INSECURE` | If set to true the connection will not attempt to use tls when connecting | http: insecure, grpc: secure | `METRICS_INSECURE`, [WithInsecure()] | +| `METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | http: insecure, grpc: secure | [WithInsecure()] | +| `HEADERS` | A list of headers to send with each request | none | `METRICS_HEADERS`, [WithHeaders()] | +| `METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | +| `COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `METRICS_COMPRESSION`, http: [WithCompression()] grpc: [WithCompressor()] | +| `METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | http: [WithCompression()] grpc: [WithCompressor()] | +| `TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `METRICS_TIMEOUT`, [WithTimeout()] | +| `METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | +| `METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Avaliable values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | + +[WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithEndpoint +[WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithInsecure +[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithHeaders +[WithCompression()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompression +[WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithCompressor +[WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTimeout +[The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration +[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTemporalitySelector \ No newline at end of file From cfe1fd6825fcdc918ae20c1e8d16c39ed00e65d4 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:05:40 -0500 Subject: [PATCH 2/9] fix spelling error --- exporters/otlp/otlpmetric/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporters/otlp/otlpmetric/readme.md b/exporters/otlp/otlpmetric/readme.md index 0a189c71b4d..ee4314cfae6 100644 --- a/exporters/otlp/otlpmetric/readme.md +++ b/exporters/otlp/otlpmetric/readme.md @@ -49,7 +49,7 @@ Note: all names are prefixed with `OTEL_EXPORTER_OTLP_` and are uppercased. | `METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | http: [WithCompression()] grpc: [WithCompressor()] | | `TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `METRICS_TIMEOUT`, [WithTimeout()] | | `METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | -| `METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Avaliable values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | +| `METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | [WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithEndpoint [WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithInsecure From 41f1be4cc32bdf827996da54164af05b1d3545a3 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:32:54 -0500 Subject: [PATCH 3/9] Lint fixes and PR feedback --- exporters/otlp/otlpmetric/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exporters/otlp/otlpmetric/readme.md b/exporters/otlp/otlpmetric/readme.md index ee4314cfae6..97ef2deba07 100644 --- a/exporters/otlp/otlpmetric/readme.md +++ b/exporters/otlp/otlpmetric/readme.md @@ -12,6 +12,7 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc or + ``` go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp ``` @@ -19,11 +20,10 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp ## Examples - [HTTP Exporter setup and examples](./otlpmetrichttp/example_test.go) -- [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector) ## [`otlpmetric`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric) -The `otlptrace` package provides common functions used within the [otlpmetricgrpc](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) and [otlpmetrichttp](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) packages. +The `otlpmetric` package provides common functions used within the [otlpmetricgrpc](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) and [otlpmetrichttp](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) packages. Exporters should be created using the New functions from the respective packages. @@ -58,4 +58,4 @@ Note: all names are prefixed with `OTEL_EXPORTER_OTLP_` and are uppercased. [WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithCompressor [WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTimeout [The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration -[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTemporalitySelector \ No newline at end of file +[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTemporalitySelector From 8f6f661e583964fae33d0ee79356d7086d488670 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Wed, 19 Jul 2023 08:21:29 -0500 Subject: [PATCH 4/9] Moved readme's to seperate modules Removed the unified readme. Added make target to lint markdown locally. --- Makefile | 4 ++ .../otlp/otlpmetric/otlpmetricgrpc/readme.md | 48 +++++++++++++++ .../otlp/otlpmetric/otlpmetrichttp/readme.md | 48 +++++++++++++++ exporters/otlp/otlpmetric/readme.md | 61 ------------------- 4 files changed, 100 insertions(+), 61 deletions(-) create mode 100644 exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md create mode 100644 exporters/otlp/otlpmetric/otlpmetrichttp/readme.md delete mode 100644 exporters/otlp/otlpmetric/readme.md diff --git a/Makefile b/Makefile index 87b9211dbd0..0902fa39727 100644 --- a/Makefile +++ b/Makefile @@ -274,3 +274,7 @@ COMMIT ?= "HEAD" add-tags: | $(MULTIMOD) @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT} + +.PHONY: lint-markdown +lint-markdown: + docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md \ No newline at end of file diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md b/exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md new file mode 100644 index 00000000000..863a2b4c862 --- /dev/null +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md @@ -0,0 +1,48 @@ +# OpenTelemetry-Go OTLP Metric GRPC Exporter + +[![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) + +[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. + +## Installation + +``` +go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc +``` + +## Examples + +- [HTTP Exporter setup and examples](./example_test.go) + +## [`otlpmetricgrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) + +Exporters should be created using the [New] and used with a [PeriodicReader]. + +## Configuration + +### Environment Variables + +The following environment variables can be used (instead of options objects) to override the default configuration. + +| Name | Description | Default | Override with | +|------|-------------|---------|---------------| +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use tls when connecting | secure | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | secure | [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | +| `OTEL_EXPORTER_OTLP_METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | +| `OTEL_EXPORTER_OTLP_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION`, [WithCompressor()] | +| `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | [WithCompressor()] | +| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | + +[PeriodicReader]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric#NewPeriodicReader +[WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithEndpoint +[WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithInsecure +[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithHeaders +[WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithCompressor +[WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTimeout +[The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration +[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTemporalitySelector diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/readme.md b/exporters/otlp/otlpmetric/otlpmetrichttp/readme.md new file mode 100644 index 00000000000..9cf10f0e5f0 --- /dev/null +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/readme.md @@ -0,0 +1,48 @@ +# OpenTelemetry-Go OTLP Metric HTTP Exporter + +[![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) + +[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. + +## Installation + +``` +go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp +``` + +## Examples + +- [HTTP Exporter setup and examples](./example_test.go) + +## [`otlpmetrichttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) + +Exporters should be created using the [New] and used with a [PeriodicReader]. + +## Configuration + +### Environment Variables + +The following environment variables can be used (instead of options objects) to override the default configuration. + +| Name | Description | Default | Override with | +|------|-------------|---------|---------------| +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use tls when connecting | insecure | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | insecure | [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | +| `OTEL_EXPORTER_OTLP_METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | +| `OTEL_EXPORTER_OTLP_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION`, [WithCompression()] | +| `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | [WithCompression()] | +| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | + +[WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithEndpoint +[WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithInsecure +[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithHeaders +[WithCompression()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompression +[WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompressor +[WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithTimeout +[The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration +[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithTemporalitySelector diff --git a/exporters/otlp/otlpmetric/readme.md b/exporters/otlp/otlpmetric/readme.md deleted file mode 100644 index 97ef2deba07..00000000000 --- a/exporters/otlp/otlpmetric/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# OpenTelemetry-Go OTLP Metric Exporter - -[![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric) - -[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. - -## Installation - -``` -go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc -``` - -or - - -``` -go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp -``` - -## Examples - -- [HTTP Exporter setup and examples](./otlpmetrichttp/example_test.go) - -## [`otlpmetric`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric) - -The `otlpmetric` package provides common functions used within the [otlpmetricgrpc](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) and [otlpmetrichttp](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) packages. - -Exporters should be created using the New functions from the respective packages. - -## Configuration - -### Environment Variables - -The following environment variables can be used (instead of options objects) to override the default configuration. -For more information about how each of these environment variables is interpreted, see [the OpenTelemetry -specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). - -Note: all names are prefixed with `OTEL_EXPORTER_OTLP_` and are uppercased. - -| Name | Description | Default | Override with | -|------|-------------|---------|---------------| -| `ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `INSECURE` to true |`http://localhost:4317`| `METRICS_ENDPOINT`, [WithEndpoint()] | -| `METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | -| `INSECURE` | If set to true the connection will not attempt to use tls when connecting | http: insecure, grpc: secure | `METRICS_INSECURE`, [WithInsecure()] | -| `METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | http: insecure, grpc: secure | [WithInsecure()] | -| `HEADERS` | A list of headers to send with each request | none | `METRICS_HEADERS`, [WithHeaders()] | -| `METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | -| `COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `METRICS_COMPRESSION`, http: [WithCompression()] grpc: [WithCompressor()] | -| `METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | http: [WithCompression()] grpc: [WithCompressor()] | -| `TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `METRICS_TIMEOUT`, [WithTimeout()] | -| `METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | -| `METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | - -[WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithEndpoint -[WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithInsecure -[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithHeaders -[WithCompression()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompression -[WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithCompressor -[WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTimeout -[The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration -[WithTemporalitySelector()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTemporalitySelector From 149d38d1957c11dc17bcf91262d4c98a52ba7017 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:40:02 -0500 Subject: [PATCH 5/9] Address PR comments. --- Makefile | 2 +- .../otlpmetricgrpc/{readme.md => README.md} | 16 +++++----------- .../otlpmetrichttp/{readme.md => README.md} | 14 ++++---------- 3 files changed, 10 insertions(+), 22 deletions(-) rename exporters/otlp/otlpmetric/otlpmetricgrpc/{readme.md => README.md} (90%) rename exporters/otlp/otlpmetric/otlpmetrichttp/{readme.md => README.md} (91%) diff --git a/Makefile b/Makefile index 0902fa39727..7b32a67aaa4 100644 --- a/Makefile +++ b/Makefile @@ -277,4 +277,4 @@ add-tags: | $(MULTIMOD) .PHONY: lint-markdown lint-markdown: - docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md \ No newline at end of file + docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md similarity index 90% rename from exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md rename to exporters/otlp/otlpmetric/otlpmetricgrpc/README.md index 863a2b4c862..4c248a58f4d 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/readme.md +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md @@ -1,8 +1,8 @@ -# OpenTelemetry-Go OTLP Metric GRPC Exporter +# OpenTelemetry-Go OTLP Metric gRPC Exporter [![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) -[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. +[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation using gRPC. ## Installation @@ -10,17 +10,11 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc ``` -## Examples +## Usage -- [HTTP Exporter setup and examples](./example_test.go) +Exporters should be created using the [New](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#New) and used with a [PeriodicReader]. -## [`otlpmetricgrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc) - -Exporters should be created using the [New] and used with a [PeriodicReader]. - -## Configuration - -### Environment Variables +## Environment Variables The following environment variables can be used (instead of options objects) to override the default configuration. diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/readme.md b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md similarity index 91% rename from exporters/otlp/otlpmetric/otlpmetrichttp/readme.md rename to exporters/otlp/otlpmetric/otlpmetrichttp/README.md index 9cf10f0e5f0..b8b2390c15b 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/readme.md +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md @@ -2,7 +2,7 @@ [![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) -[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. +[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation using HTTP with protobuf-encoded payloads. ## Installation @@ -10,17 +10,11 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp ``` -## Examples +## Usage -- [HTTP Exporter setup and examples](./example_test.go) +Exporters should be created using the [New](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#New) and used with a [PeriodicReader]. -## [`otlpmetrichttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp) - -Exporters should be created using the [New] and used with a [PeriodicReader]. - -## Configuration - -### Environment Variables +## Environment Variables The following environment variables can be used (instead of options objects) to override the default configuration. From fe12dff9e9901a0171e1e601c7a02d882cde1409 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Fri, 29 Sep 2023 09:49:31 -0500 Subject: [PATCH 6/9] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Robert PajÄ…k --- .../otlp/otlpmetric/otlpmetricgrpc/README.md | 16 ++++++++-------- .../otlp/otlpmetric/otlpmetrichttp/README.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md index 4c248a58f4d..93354df06c0 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md @@ -20,22 +20,22 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use tls when connecting | secure | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | -| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | secure | [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | | `OTEL_EXPORTER_OTLP_METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | | `OTEL_EXPORTER_OTLP_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION`, [WithCompressor()] | | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | [WithCompressor()] | -| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | -| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | -| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | +| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time (as milliseconds) an Exporter will attempt an export | `10000` | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time (as milliseconds) an Exporter will attempt an export | `10000` | [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details | `Cumulative` | [WithTemporalitySelector()] | [PeriodicReader]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric#NewPeriodicReader [WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithEndpoint [WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithInsecure -[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithHeaders +[WithHeaders()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithHeaders [WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithCompressor [WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc#WithTimeout [The OTLP Exporter Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md#additional-configuration diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md index b8b2390c15b..4d8f39e8c04 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md @@ -20,21 +20,21 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true |`http://localhost:4317`| [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use tls when connecting | insecure | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | -| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use tls when connecting | insecure | [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317/v1/metrics` | [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | +| `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | | `OTEL_EXPORTER_OTLP_METRICS_HEADERS` | A list of headers to send with each request | none | [WithHeaders()] | | `OTEL_EXPORTER_OTLP_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION`, [WithCompression()] | | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` | Sets the compressions used in the connection. Supports `none` and `gzip`. Must import the compressor for gzip to work. | none | [WithCompression()] | -| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | -| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time an Exporter will attempt an export | 10s | [WithTimeout()] | -| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details| Cumulative | [WithTemporalitySelector()] | +| `OTEL_EXPORTER_OTLP_TIMEOUT` | Sets the max amount of time (as milliseconds) an Exporter will attempt an export | `10000` | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`, [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Sets the max amount of time (as milliseconds) an Exporter will attempt an export | `10000` | [WithTimeout()] | +| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details | `Cumulative` | [WithTemporalitySelector()] | [WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithEndpoint [WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithInsecure -[WithHeader()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithHeaders +[WithHeaders()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithHeaders [WithCompression()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompression [WithCompressor()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompressor [WithTimeout()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithTimeout From 3bdc14fb6ac6fb4625e08427c60136399d6694fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 27 Oct 2023 10:41:58 +0200 Subject: [PATCH 7/9] Apply suggestions from code review --- exporters/otlp/otlpmetric/otlpmetricgrpc/README.md | 4 ++-- exporters/otlp/otlpmetric/otlpmetrichttp/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md index 93354df06c0..0b3a39947cc 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/README.md @@ -20,8 +20,8 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317` | [WithEndpoint()] | | `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | | `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md index 4d8f39e8c04..0819ba73307 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md @@ -20,8 +20,8 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `http://localhost:4317/v1/metrics` | [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317/v1/metrics` | [WithEndpoint()] | | `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | | `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | From 273c39a486dccd8c77655ccfd0c2f40528a1cd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 27 Oct 2023 10:44:40 +0200 Subject: [PATCH 8/9] Update exporters/otlp/otlpmetric/otlpmetrichttp/README.md --- exporters/otlp/otlpmetric/otlpmetrichttp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md index 0819ba73307..ea46e0e6ac1 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md @@ -21,7 +21,7 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| | `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317/v1/metrics` | [WithEndpoint()] | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317/v1/metrics` | | | `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | | `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | From 7918ebf1732b97e344b95ecc69d69fe13a8e7507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 30 Oct 2023 13:19:57 +0100 Subject: [PATCH 9/9] Apply suggestions from code review --- exporters/otlp/otlpmetric/otlpmetrichttp/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md index ea46e0e6ac1..114c5d32686 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/README.md +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/README.md @@ -21,7 +21,7 @@ The following environment variables can be used (instead of options objects) to | Name | Description | Default | Override with | |------|-------------|---------|---------------| | `OTEL_EXPORTER_OTLP_ENDPOINT` | Endpoint to which the exporter is going to send traces or metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, [WithEndpoint()] | -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317/v1/metrics` | | +| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Endpoint to which the exporter is going to send metrics. If the scheme is `http` or `unix` this will also set `OTEL_EXPORTER_OTLP_INSECURE` to true | `https://localhost:4317/v1/metrics` | [WithEndpoint()] and [WithURLPath()] | | `OTEL_EXPORTER_OTLP_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | `OTEL_EXPORTER_OTLP_METRICS_INSECURE`, [WithInsecure()] | | `OTEL_EXPORTER_OTLP_METRICS_INSECURE` | If set to true the connection will not attempt to use TLS when connecting | `false` | [WithInsecure()] | | `OTEL_EXPORTER_OTLP_HEADERS` | A list of headers to send with each request | none | `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, [WithHeaders()] | @@ -33,6 +33,7 @@ The following environment variables can be used (instead of options objects) to | `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. Available values are `Cumulative`, `Delta`, and `LowMemory`. See [The OTLP Exporter Specification] for more details | `Cumulative` | [WithTemporalitySelector()] | [WithEndpoint()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithEndpoint +[WithURLPath()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithURLPath [WithInsecure()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithInsecure [WithHeaders()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithHeaders [WithCompression()]: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp#WithCompression