Skip to content

Commit

Permalink
Reorganize specification related to OTLP file exporter (#3031)
Browse files Browse the repository at this point in the history
Fixes #3003 
Contributes to #2911

## Changes

This PR moves and reorganizes parts of the specification relevant to exporting OTLP data to a file.

* Removes the "Build-in exporters" section from the Log SDK. The OTLP exporter has its own specification covering all signals. The part regarding a file exporter is not unique to logs. Exporting OTLP data to a file is also applicable to trace and metric data.
* Moves the file describing OTLP JSON serialization under the `protocol` subdirectory. As discussed in the Logs SIG (12/7/2022), this file provides a foundation for further progress on specifying an OTLP file exporter.
  • Loading branch information
alanwest committed Jan 3, 2023
1 parent 619551a commit 56c20c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 31 deletions.
2 changes: 1 addition & 1 deletion specification/logs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ If included, they MUST follow the OpenTelemetry
## Example Log Records

For example log records see
[JSON File serialization](../../experimental/serialization/json.md).
[JSON File serialization](../protocol/file-exporter.md#examples).

## Appendix A. Example Mappings

Expand Down
Binary file removed specification/logs/img/otlp-file.png
Binary file not shown.
21 changes: 0 additions & 21 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
+ [Export](#export)
+ [ForceFlush](#forceflush-2)
+ [Shutdown](#shutdown-1)
* [Built-in exporters](#built-in-exporters)
+ [OTLP Exporter](#otlp-exporter)
+ [OTLP File exporter](#otlp-file-exporter)

<!-- tocstop -->

Expand Down Expand Up @@ -365,21 +362,3 @@ return a Failure result.
`Shutdown` SHOULD NOT block indefinitely (e.g. if it attempts to flush the data
and the destination is unavailable). [OpenTelemetry SDK](../overview.md#sdk)
authors MAY decide if they want to make the shutdown timeout configurable.

### Built-in exporters

TODO: Break out into files under `./sdk_exporters`.

#### OTLP Exporter

Exports to an OTLP network destination via OTLP/gRPC or OTLP/HTTP.

#### OTLP File exporter

Writes to a file or stdout in either OTLP JSON or OTLP Protobuf binary format.

![Logging to File](img/otlp-file.png)

TODO: clarify how this functionality co-exists with the overlapping
functionality in logging libraries that allow specifying how logs are written to
a file.
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# JSON File serialization
# OpenTelemetry Protocol File Exporter

**Status**: [Experimental](../../specification/document-status.md)

This document provides a placeholder for specifying an OTLP exporter capable of
exporting to either a file or stdout.

Currently, it only describes the serialization of OpenTelemetry data to the OTLP JSON format.

## Table of Contents

- [Overview](#overview)
- [Requirements](#requirements)
- [JSON File serialization](#json-file-serialization)
- [File storage requirements](#file-storage-requirements)
- [JSON lines file](#json-lines-file)
- [Streaming appending](#streaming-appending)
- [Telemetry data requirements](#telemetry-data-requirements)
- [Examples](#examples)
- [Examples](#examples)

## Overview
## JSON File serialization

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

## Requirements

### File storage requirements

#### JSON lines file
Expand All @@ -33,7 +35,7 @@ This file is a JSON lines file (jsonlines.org), and therefore follows those requ

There is no guarantee that the data in the file is ordered.

There is no guarantee in particular that timestamps will be monotically increasing.
There is no guarantee in particular that timestamps will be monotonically increasing.

### Telemetry data requirements

Expand All @@ -46,7 +48,7 @@ Only top-level objects, `ExportTraceServiceRequest`, `ExportMetricsServiceReques

Files must contain exactly one type of data: traces, metrics, or logs.

## Examples
### Examples

This is an example showing traces:

Expand Down

0 comments on commit 56c20c2

Please sign in to comment.