| 1 | # OTLP/HTTP Exporter |
| 2 | |
| 3 | <!-- status autogenerated section --> |
| 4 | | Status | | |
| 5 | | ------------- |-----------| |
| 6 | | Stability | [development]: profiles | |
| 7 | | | [stable]: traces, metrics, logs | |
| 8 | | Distributions | [core], [contrib], [k8s], [otlp] | |
| 9 | | Issues | [](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fotlphttp) [](https://github.com/open-telemetry/opentelemetry-collector/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fotlphttp) | |
| 10 | |
| 11 | [development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development |
| 12 | [stable]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#stable |
| 13 | [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol |
| 14 | [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib |
| 15 | [k8s]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s |
| 16 | [otlp]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-otlp |
| 17 | <!-- end autogenerated section --> |
| 18 | |
| 19 | Export traces and/or metrics via HTTP using [OTLP]( |
| 20 | https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md) |
| 21 | format. |
| 22 | |
| 23 | The following settings are required: |
| 24 | |
| 25 | - `endpoint` (no default): The target base URL to send data to (e.g.: https://example.com:4318). |
| 26 | To send each signal a corresponding path will be added to this base URL, i.e. for traces |
| 27 | "/v1/traces" will appended, for metrics "/v1/metrics" will be appended, for logs |
| 28 | "/v1/logs" will be appended. |
| 29 | |
| 30 | The following settings can be optionally configured: |
| 31 | |
| 32 | - `traces_endpoint` (no default): The target URL to send trace data to (e.g.: https://example.com:4318/v1/traces). |
| 33 | If this setting is present the `endpoint` setting is ignored for traces. |
| 34 | - `metrics_endpoint` (no default): The target URL to send metric data to (e.g.: https://example.com:4318/v1/metrics). |
| 35 | If this setting is present the `endpoint` setting is ignored for metrics. |
| 36 | - `logs_endpoint` (no default): The target URL to send log data to (e.g.: https://example.com:4318/v1/logs). |
| 37 | - `profiles_endpoint` (no default): The target URL to send profile data to (e.g.: https://example.com:4318/v1development/profiles). |
| 38 | If this setting is present the `endpoint` setting is ignored for logs. |
| 39 | - `tls`: see [TLS Configuration Settings](../../config/configtls/README.md) for the full set of available options. |
| 40 | - `timeout` (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client |
| 41 | - `read_buffer_size` (default = 0): ReadBufferSize for HTTP client. |
| 42 | - `write_buffer_size` (default = 512 * 1024): WriteBufferSize for HTTP client. |
| 43 | - `encoding` (default = proto): The encoding to use for the messages (valid options: `proto`, `json`) |
| 44 | - `retry_on_failure`: see [Retry on Failure](../exporterhelper/README.md#retry-on-failure) for the full set of available options. |
| 45 | - `sending_queue`: see [Sending Queue](../exporterhelper/README.md#sending-queue) for the full set of available options. |
| 46 | |
| 47 | Example: |
| 48 | |
| 49 | ```yaml |
| 50 | exporters: |
| 51 | otlphttp: |
| 52 | endpoint: https://example.com:4318 |
| 53 | ``` |
| 54 | |
| 55 | By default `gzip` compression is enabled. See [compression comparison](../../config/configgrpc/README.md#compression-comparison) for details benchmark information. To disable, configure as follows: |
| 56 | |
| 57 | ```yaml |
| 58 | exporters: |
| 59 | otlphttp: |
| 60 | ... |
| 61 | compression: none |
| 62 | ``` |
| 63 | |
| 64 | By default `proto` encoding is used, to change the content encoding of the message configure it as follows: |
| 65 | |
| 66 | ```yaml |
| 67 | exporters: |
| 68 | otlphttp: |
| 69 | ... |
| 70 | encoding: json |
| 71 | ``` |
| 72 | |
| 73 | The full list of settings exposed for this exporter are documented [here](./config.go) |
| 74 | with detailed sample configurations [here](./testdata/config.yaml). |