Skip to content

Commit 79380c6

Browse files
zeitlingerpellaredcyrille-leclerccijothomas
authored
Add OTLP stdout exporter (#4183)
Towards #3817 ## Changes Add OTLP Stdout exporter. For non-trivial changes, follow the [change proposal process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change). * [x] Related issues #3817 ~* [ ] Related [OTEP(s)](https://github.com/open-telemetry/oteps) #~ * [x] Links to the prototypes: open-telemetry/opentelemetry-java#6632 * [x] [`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md) file updated for non-trivial changes ~* [ ] [`spec-compliance-matrix.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md) updated if necessary~ * [x] reference implementation open-telemetry/opentelemetry-java#6632 --------- Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: Cyrille Le Clerc <[email protected]> Co-authored-by: Cijo Thomas <[email protected]>
1 parent 881f364 commit 79380c6

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@ release.
1111

1212
### Traces
1313

14+
- Add in-development support for `otlp/stdout` exporter via `OTEL_TRACES_EXPORTER`.
15+
([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183))
16+
1417
### Metrics
1518

19+
- Add in-development support for `otlp/stdout` exporter via `OTEL_METRICS_EXPORTER`.
20+
([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183))
21+
1622
### Logs
1723

24+
- Add in-development support for `otlp/stdout` exporter via `OTEL_LOGS_EXPORTER`.
25+
([#4183](https://github.com/open-telemetry/opentelemetry-specification/pull/4183))
26+
1827
### Events
1928

2029
### Baggage

specification/configuration/sdk-environment-variables.md

+19
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ aliases:
3232
- [Zipkin Exporter](#zipkin-exporter)
3333
- [Prometheus Exporter](#prometheus-exporter)
3434
- [Exporter Selection](#exporter-selection)
35+
* [In-development Exporter Selection](#in-development-exporter-selection)
3536
- [Metrics SDK Configuration](#metrics-sdk-configuration)
3637
* [Exemplar](#exemplar)
3738
* [Periodic exporting MetricReader](#periodic-exporting-metricreader)
@@ -270,6 +271,24 @@ Known values for `OTEL_LOGS_EXPORTER` are:
270271
NOT be supported by new implementations.
271272
- `"none"`: No automatically configured exporter for logs.
272273

274+
### In-development Exporter Selection
275+
276+
**Status**: [Development](../document-status.md)
277+
278+
In addition to the above, the following environment variables are added for in-development exporter selection:
279+
280+
Additional known values for `OTEL_TRACES_EXPORTER` are:
281+
282+
- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output
283+
284+
Additional known values for `OTEL_METRICS_EXPORTER` are:
285+
286+
- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output
287+
288+
Additional known values for `OTEL_LOGS_EXPORTER` are:
289+
290+
- `"otlp/stdout"`: [OTLP File](../protocol/file-exporter.md) writing to standard output
291+
273292
## Metrics SDK Configuration
274293

275294
### Exemplar

specification/protocol/file-exporter.md

+33
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,46 @@ Currently, it only describes the serialization of OpenTelemetry data to the OTLP
1313

1414
## Table of Contents
1515

16+
- [Use Cases](#use-cases)
17+
- [Exporter configuration](#exporter-configuration)
18+
- [Programmatic configuration](#programmatic-configuration)
1619
- [JSON File serialization](#json-file-serialization)
1720
- [File storage requirements](#file-storage-requirements)
1821
- [JSON lines file](#json-lines-file)
1922
- [Streaming appending](#streaming-appending)
2023
- [Telemetry data requirements](#telemetry-data-requirements)
2124
- [Examples](#examples)
2225

26+
## Use Cases
27+
28+
Why do we need a file exporter - why not just use the OTLP exporter?
29+
30+
- *Faas*: In a FaaS environment, the OTLP exporter may not be able to send data to a collector.
31+
- *Consistent log scraping from pods*: In a Kubernetes environment, logs are often scraped from the stdout pod file.
32+
This exporter can be used to write logs to stdout - which makes it easier to integrate with existing log scraping tools.
33+
Existing solutions add metadata, such as the trace ID, to the log line,
34+
which needs manual configuration and is error-prone.
35+
- *Reliability*: Some prefer writing logs to a file rather than sending data over the network for reliability reasons.
36+
37+
## Exporter configuration
38+
39+
The metric exporter MUST support the environment variables defined in the
40+
[OTLP Exporter](../metrics/sdk_exporters/otlp.md#additional-environment-variable-configuration)
41+
specification.
42+
43+
If a language provides a mechanism to automatically configure a
44+
span or logs processor to pair with the associated
45+
exporter (e.g., using the [`OTEL_TRACES_EXPORTER` environment
46+
variable](../configuration/sdk-environment-variables.md#exporter-selection)), by
47+
default the OpenTelemetry Protocol File Exporter SHOULD be paired with a batching
48+
processor.
49+
50+
### Programmatic configuration
51+
52+
| Requirement | Name | Description | Default |
53+
|-------------|----------------------------|--------------------------------------------------------------------------------------------------------|---------|
54+
| MUST | output stream (or similar) | Configure output stream. This SHOULD include the possibility to configure the output stream to a file. | stdout |
55+
2356
## JSON File serialization
2457

2558
This document describes the serialization of OpenTelemetry data as JSON objects that can be stored in files.

0 commit comments

Comments
 (0)