diff --git a/CHANGELOG.md b/CHANGELOG.md index 9041036f9c5..dd7bc1741d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,19 @@ release. ### Traces +- Add in-development support for `otlp/stdout` exporter via `OTEL_TRACES_EXPORTER`. + ([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183)) + ### Metrics +- Add in-development support for `otlp/stdout` exporter via `OTEL_METRICS_EXPORTER`. + ([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183)) + ### Logs +- Add in-development support for `otlp/stdout` exporter via `OTEL_LOGS_EXPORTER`. + ([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183)) + ### Events ### Baggage diff --git a/specification/configuration/sdk-environment-variables.md b/specification/configuration/sdk-environment-variables.md index 0014d3357e8..8a428fa0deb 100644 --- a/specification/configuration/sdk-environment-variables.md +++ b/specification/configuration/sdk-environment-variables.md @@ -32,6 +32,7 @@ aliases: - [Zipkin Exporter](#zipkin-exporter) - [Prometheus Exporter](#prometheus-exporter) - [Exporter Selection](#exporter-selection) + * [In-development Exporter Selection](#in-development-exporter-selection) - [Metrics SDK Configuration](#metrics-sdk-configuration) * [Exemplar](#exemplar) * [Periodic exporting MetricReader](#periodic-exporting-metricreader) @@ -270,6 +271,24 @@ Known values for `OTEL_LOGS_EXPORTER` are: NOT be supported by new implementations. - `"none"`: No automatically configured exporter for logs. +### In-development Exporter Selection + +**Status**: [Development](../document-status.md) + +In addition to the above, the following environment variables are added for in-development exporter selection: + +Additional known values for `OTEL_TRACES_EXPORTER` are: + +- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output + +Additional known values for `OTEL_METRICS_EXPORTER` are: + +- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output + +Additional known values for `OTEL_LOGS_EXPORTER` are: + +- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output + ## Metrics SDK Configuration ### Exemplar diff --git a/specification/protocol/file-exporter.md b/specification/protocol/file-exporter.md index c9b8d800bc8..a60cce1539f 100644 --- a/specification/protocol/file-exporter.md +++ b/specification/protocol/file-exporter.md @@ -13,6 +13,9 @@ Currently, it only describes the serialization of OpenTelemetry data to the OTLP ## Table of Contents +- [Use Cases](#use-cases) +- [Exporter configuration](#exporter-configuration) + - [Programmatic configuration](#programmatic-configuration) - [JSON File serialization](#json-file-serialization) - [File storage requirements](#file-storage-requirements) - [JSON lines file](#json-lines-file) @@ -20,6 +23,36 @@ Currently, it only describes the serialization of OpenTelemetry data to the OTLP - [Telemetry data requirements](#telemetry-data-requirements) - [Examples](#examples) +## Use Cases + +Why do we need a file exporter - why not just use the OTLP exporter? + +- *Faas*: In a FaaS environment, the OTLP exporter may not be able to send data to a collector. +- *Consistent log scraping from pods*: In a Kubernetes environment, logs are often scraped from the stdout pod file. + This exporter can be used to write logs to stdout - which makes it easier to integrate with existing log scraping tools. + Existing solutions add metadata, such as the trace ID, to the log line, + which needs manual configuration and is error-prone. +- *Reliability*: Some prefer writing logs to a file rather than sending data over the network for reliability reasons. + +## Exporter configuration + +The metric exporter MUST support the environment variables defined in the +[OTLP Exporter](../metrics/sdk_exporters/otlp.md#additional-environment-variable-configuration) +specification. + +If a language provides a mechanism to automatically configure a +span or logs processor to pair with the associated +exporter (e.g., using the [`OTEL_TRACES_EXPORTER` environment +variable](../configuration/sdk-environment-variables.md#exporter-selection)), by +default the OpenTelemetry Protocol File Exporter SHOULD be paired with a batching +processor. + +### Programmatic configuration + +| Requirement | Name | Description | Default | +|-------------|----------------------------|--------------------------------------------------------------------------------------------------------|---------| +| MUST | output stream (or similar) | Configure output stream. This SHOULD include the possibility to configure the output stream to a file. | stdout | + ## JSON File serialization This document describes the serialization of OpenTelemetry data as JSON objects that can be stored in files.