Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize trace context in non-OTLP formats and define casing #3909

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ release.

### Compatibility

- Define casing for hex-encoded IDs and mark the "Trace Context in non-OTLP Log Formats" specification stable.
([#3909](https://github.com/open-telemetry/opentelemetry-specification/pull/3909))

### SDK Configuration

### Common
Expand Down
12 changes: 6 additions & 6 deletions specification/compatibility/logging_trace_context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Trace Context in non-OTLP Log Formats
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

**Status**: [Development](../document-status.md)
**Status**: [Stable](../document-status.md)
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
dashpole marked this conversation as resolved.
Show resolved Hide resolved

<details>
<summary>Table of Contents</summary>
Expand All @@ -24,8 +24,8 @@ representing [trace context](../logs/data-model.md#trace-context-fields). This
document defines how trace context should be recorded in non-OTLP Log Formats.
To summarize, the following field names should be used in legacy formats:

- "trace_id" for [TraceId](../logs/data-model.md#field-traceid), hex-encoded.
- "span_id" for [SpanId](../logs/data-model.md#field-spanid), hex-encoded.
- "trace_id" for [TraceId](../logs/data-model.md#field-traceid), lowercase and hex-encoded.
- "span_id" for [SpanId](../logs/data-model.md#field-spanid), lowercase and hex-encoded.
- "trace_flags" for [trace flags](../logs/data-model.md#field-traceflags), formatted
according to W3C traceflags format.

Expand All @@ -39,7 +39,7 @@ Trace id, span id and traceflags SHOULD be recorded via SD-ID "opentelemetry".
For example:

```
[opentelemetry trace_id="102981ABCD2901" span_id="abcdef1010" trace_flags="01"]
[opentelemetry trace_id="102981abcd2901" span_id="abcdef1010" trace_flags="01"]
```

### Plain Text Formats
Expand All @@ -48,7 +48,7 @@ The fields SHOULD be recorded according to the customary approach used for a
particular format (e.g. field:value format for LTSV). For example:

```
host:192.168.0.1<TAB>trace_id:102981ABCD2901<TAB>span_id:abcdef1010<TAB>time:[01/Jan/2010:10:11:23 -0400]<TAB>req:GET /health HTTP/1.0<TAB>status:200
host:192.168.0.1<TAB>trace_id:102981abcd2901<TAB>span_id:abcdef1010<TAB>time:[01/Jan/2010:10:11:23 -0400]<TAB>req:GET /health HTTP/1.0<TAB>status:200
```

### JSON Formats
Expand All @@ -59,7 +59,7 @@ The fields SHOULD be recorded as top-level fields in the JSON structure. For exa
{
"timestamp":1581385157.14429,
"body":"Incoming request",
"trace_id":"102981ABCD2901",
"trace_id":"102981abcd2901",
"span_id":"abcdef1010"
}
```
Expand Down
Loading