From 8d09f7a5e3df7c70ccce496ee72db6f7821a9489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 4 Apr 2024 08:45:57 +0200 Subject: [PATCH 1/2] Add otlploghttp package documentation --- exporters/otlp/otlplog/otlploghttp/doc.go | 61 ++++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/exporters/otlp/otlplog/otlploghttp/doc.go b/exporters/otlp/otlplog/otlploghttp/doc.go index 0d0ab6a5dd2..bb489b5a961 100644 --- a/exporters/otlp/otlplog/otlploghttp/doc.go +++ b/exporters/otlp/otlplog/otlploghttp/doc.go @@ -1,6 +1,63 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -// Package otlploghttp provides an OTLP log exporter. The exporter uses HTTP to -// transport OTLP protobuf payloads. +/* +Package otlploghttp provides an OTLP log exporter. The exporter uses HTTP to +transport OTLP protobuf payloads. + +Exporter should be created using [New]. + +The environment variables described below can be used for configuration. + +OTEL_EXPORTER_OTLP_ENDPOINT (default: "https://localhost:4318") - +target base URL ("/v1/logs" is appended) to which the exporter sends telemetry. +The value must contain a scheme ("http" or "https") and host. +The value may additionally contain a port and a path. +The value should not contain a query string or fragment. +The configuration can be overridden by OTEL_EXPORTER_OTLP_LOGS_ENDPOINT +environment variable and by [WithEndpoint], [WithEndpointURL], [WithInsecure] options. + +OTEL_EXPORTER_OTLP_LOGS_ENDPOINT (default: "https://localhost:4318/v1/logs") - +target URL to which the exporter sends telemetry. +The value must contain a scheme ("http" or "https") and host. +The value may additionally contain a port and a path. +The value should not contain a query string or fragment. +The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnInsecure], and [WithURLPath] options. + +OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS (default: none) - +key-value pairs used as headers associated with HTTP requests. +The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +except that additional semi-colon delimited metadata is not supported. +Example value: "key1=value1,key2=value2". +OTEL_EXPORTER_OTLP_LOGS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. +The configuration can be overridden by [WithHeaders] option. + +OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_LOGS_TIMEOUT (default: "10000") - +maximum time in milliseconds the OTLP exporter waits for each batch export. +OTEL_EXPORTER_OTLP_LOGS_TIMEOUT takes precedence over OTEL_EXPORTER_OTLP_TIMEOUT. +The configuration can be overridden by [WithTimeout] option. + +OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_LOGS_COMPRESSION (default: none) - +the compression strategy the exporter uses to compress the HTTP body. +Supported value: "gzip". +OTEL_EXPORTER_OTLP_LOGS_COMPRESSION takes precedence over OTEL_EXPORTER_OTLP_COMPRESSION. +The configuration can be overridden by [WithCompression] option. + +OTEL_EXPORTER_OTLP_CERTIFICATE, OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE (default: none) - +the filepath to the trusted certificate to use when verifying a server's TLS credentials. +OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CERTIFICATE. +The configuration can be overridden by [WithTLSClientConfig] option. + +OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE (default: none) - +the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. +The configuration can be overridden by [WithTLSClientConfig] option. + +OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY (default: none) - +the filepath to the clients private key to use in mTLS communication in PEM format. +OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. +The configuration can be overridden by [WithTLSClientConfig] option. + +[W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content +*/ package otlploghttp // import "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp" From f0b2259f5c86d02227dd1de3a0616ada5fafb6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 4 Apr 2024 10:42:38 +0200 Subject: [PATCH 2/2] Fix errors --- exporters/otlp/otlplog/otlploghttp/doc.go | 6 +++--- exporters/otlp/otlpmetric/otlpmetricgrpc/doc.go | 6 +++--- exporters/otlp/otlpmetric/otlpmetrichttp/doc.go | 6 +++--- exporters/otlp/otlptrace/otlptracegrpc/doc.go | 6 +++--- exporters/otlp/otlptrace/otlptracehttp/doc.go | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/exporters/otlp/otlplog/otlploghttp/doc.go b/exporters/otlp/otlplog/otlploghttp/doc.go index bb489b5a961..87e55efe091 100644 --- a/exporters/otlp/otlplog/otlploghttp/doc.go +++ b/exporters/otlp/otlplog/otlploghttp/doc.go @@ -26,7 +26,7 @@ The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnI OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. -The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], except that additional semi-colon delimited metadata is not supported. Example value: "key1=value1,key2=value2". OTEL_EXPORTER_OTLP_LOGS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. @@ -49,12 +49,12 @@ OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CER The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE (default: none) - -the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY (default: none) - -the filepath to the clients private key to use in mTLS communication in PEM format. +the filepath to the client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. The configuration can be overridden by [WithTLSClientConfig] option. diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/doc.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/doc.go index df6e3459571..3d74ef1a01d 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/doc.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/doc.go @@ -29,7 +29,7 @@ The configuration can be overridden by [WithInsecure], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS (default: none) - key-value pairs used as gRPC metadata associated with gRPC requests. -The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], except that additional semi-colon delimited metadata is not supported. Example value: "key1=value1,key2=value2". OTEL_EXPORTER_OTLP_METRICS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. @@ -52,12 +52,12 @@ OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_ The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE (default: none) - -the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY (default: none) - -the filepath to the clients private key to use in mTLS communication in PEM format. +the filepath to the client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option. diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go b/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go index 93d843d348c..eabb82b9847 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go @@ -26,7 +26,7 @@ The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnI OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. -The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], except that additional semi-colon delimited metadata is not supported. Example value: "key1=value1,key2=value2". OTEL_EXPORTER_OTLP_METRICS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. @@ -49,12 +49,12 @@ OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_ The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE (default: none) - -filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY (default: none) - -filepath to the clients private key to use in mTLS communication in PEM format. +filepath to the client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. The configuration can be overridden by [WithTLSClientConfig] option. diff --git a/exporters/otlp/otlptrace/otlptracegrpc/doc.go b/exporters/otlp/otlptrace/otlptracegrpc/doc.go index 3709d7dcf03..e783b57ac4b 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/doc.go +++ b/exporters/otlp/otlptrace/otlptracegrpc/doc.go @@ -29,7 +29,7 @@ The configuration can be overridden by [WithInsecure], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) - key-value pairs used as gRPC metadata associated with gRPC requests. -The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], except that additional semi-colon delimited metadata is not supported. Example value: "key1=value1,key2=value2". OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. @@ -52,12 +52,12 @@ OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_C The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE (default: none) - -the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options. OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY (default: none) - -the filepath to the clients private key to use in mTLS communication in PEM format. +the filepath to the client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option. diff --git a/exporters/otlp/otlptrace/otlptracehttp/doc.go b/exporters/otlp/otlptrace/otlptracehttp/doc.go index 18843d62945..43534cbfba4 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/doc.go +++ b/exporters/otlp/otlptrace/otlptracehttp/doc.go @@ -26,7 +26,7 @@ The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnI OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. -The value is expected to be represented in a format matching to the [W3C Baggage HTTP Header Content Format], +The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], except that additional semi-colon delimited metadata is not supported. Example value: "key1=value1,key2=value2". OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. @@ -49,12 +49,12 @@ OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_C The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE (default: none) - -the filepath to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format. +the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. The configuration can be overridden by [WithTLSClientConfig] option. OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY (default: none) - -the filepath to the clients private key to use in mTLS communication in PEM format. +the filepath to the client's private key to use in mTLS communication in PEM format. OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. The configuration can be overridden by [WithTLSClientConfig] option.