| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
/* |
| 5 |
Package otlpmetrichttp provides an OTLP metrics exporter using HTTP with protobuf payloads. |
| 6 |
By default the telemetry is sent to https://localhost:4318/v1/metrics. |
| 7 |
|
| 8 |
Exporter should be created using [New] and used with a [metric.PeriodicReader]. |
| 9 |
|
| 10 |
The environment variables described below can be used for configuration. |
| 11 |
|
| 12 |
OTEL_EXPORTER_OTLP_ENDPOINT (default: "https://localhost:4318") - |
| 13 |
target base URL ("/v1/metrics" is appended) to which the exporter sends telemetry. |
| 14 |
The value must contain a scheme ("http" or "https") and host. |
| 15 |
The value may additionally contain a port and a path. |
| 16 |
The value should not contain a query string or fragment. |
| 17 |
The configuration can be overridden by OTEL_EXPORTER_OTLP_METRICS_ENDPOINT |
| 18 |
environment variable and by [WithEndpoint], [WithEndpointURL], and [WithInsecure] options. |
| 19 |
|
| 20 |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT (default: "https://localhost:4318/v1/metrics") - |
| 21 |
target URL to which the exporter sends telemetry. |
| 22 |
The value must contain a scheme ("http" or "https") and host. |
| 23 |
The value may additionally contain a port and a path. |
| 24 |
The value should not contain a query string or fragment. |
| 25 |
The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithURLPath] options. |
| 26 |
|
| 27 |
OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_METRICS_INSECURE (default: "false") - |
| 28 |
setting "true" disables client transport security for the exporter's HTTP connection. |
| 29 |
OTEL_EXPORTER_OTLP_METRICS_INSECURE takes precedence over OTEL_EXPORTER_OTLP_INSECURE. |
| 30 |
The configuration can be overridden by [WithInsecure] and [WithTLSClientConfig] options. |
| 31 |
|
| 32 |
OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS (default: none) - |
| 33 |
key-value pairs used as headers associated with HTTP requests. |
| 34 |
The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format], |
| 35 |
except that additional semi-colon delimited metadata is not supported. |
| 36 |
Example value: "key1=value1,key2=value2". |
| 37 |
OTEL_EXPORTER_OTLP_METRICS_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS. |
| 38 |
The configuration can be overridden by [WithHeaders] option. |
| 39 |
|
| 40 |
OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_METRICS_TIMEOUT (default: "10000") - |
| 41 |
maximum time in milliseconds the OTLP exporter waits for each batch export. |
| 42 |
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT takes precedence over OTEL_EXPORTER_OTLP_TIMEOUT. |
| 43 |
The configuration can be overridden by [WithTimeout] option. |
| 44 |
|
| 45 |
OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_METRICS_COMPRESSION (default: none) - |
| 46 |
compression strategy the exporter uses to compress the HTTP body. |
| 47 |
Supported values: "gzip". |
| 48 |
OTEL_EXPORTER_OTLP_METRICS_COMPRESSION takes precedence over OTEL_EXPORTER_OTLP_COMPRESSION. |
| 49 |
The configuration can be overridden by [WithCompression] option. |
| 50 |
|
| 51 |
OTEL_EXPORTER_OTLP_CERTIFICATE, OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE (default: none) - |
| 52 |
filepath to the trusted certificate to use when verifying a server's TLS credentials. |
| 53 |
OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CERTIFICATE. |
| 54 |
The configuration can be overridden by [WithTLSClientConfig] option. |
| 55 |
|
| 56 |
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE (default: none) - |
| 57 |
filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format. |
| 58 |
OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE. |
| 59 |
The configuration can be overridden by [WithTLSClientConfig] option. |
| 60 |
|
| 61 |
OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY (default: none) - |
| 62 |
filepath to the client's private key to use in mTLS communication in PEM format. |
| 63 |
OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY. |
| 64 |
The configuration can be overridden by [WithTLSClientConfig] option. |
| 65 |
|
| 66 |
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE (default: "cumulative") - |
| 67 |
aggregation temporality to use on the basis of instrument kind. Supported values: |
| 68 |
- "cumulative" - Cumulative aggregation temporality for all instrument kinds, |
| 69 |
- "delta" - Delta aggregation temporality for Counter, Asynchronous Counter and Histogram instrument kinds; |
| 70 |
Cumulative aggregation for UpDownCounter and Asynchronous UpDownCounter instrument kinds, |
| 71 |
- "lowmemory" - Delta aggregation temporality for Synchronous Counter and Histogram instrument kinds; |
| 72 |
Cumulative aggregation temporality for Synchronous UpDownCounter, Asynchronous Counter, and Asynchronous UpDownCounter instrument kinds. |
| 73 |
|
| 74 |
The configuration can be overridden by [WithTemporalitySelector] option. |
| 75 |
|
| 76 |
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION (default: "explicit_bucket_histogram") - |
| 77 |
default aggregation to use for histogram instruments. Supported values: |
| 78 |
- "explicit_bucket_histogram" - [Explicit Bucket Histogram Aggregation], |
| 79 |
- "base2_exponential_bucket_histogram" - [Base2 Exponential Bucket Histogram Aggregation]. |
| 80 |
|
| 81 |
The configuration can be overridden by [WithAggregationSelector] option. |
| 82 |
|
| 83 |
[W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content |
| 84 |
[Explicit Bucket Histogram Aggregation]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation |
| 85 |
[Base2 Exponential Bucket Histogram Aggregation]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation |
| 86 |
*/ |
| 87 |
package otlpmetrichttp // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp" |