Skip to content

Commit 9d4acd9

Browse files
authored
Stabilize trace context in non-OTLP formats and define casing (#3909)
Closes #3303 ## Changes From @tigrannajaryan in #3303 (comment): > I think the conclusion in #3518 was that we keep the names. It has been a while and there is no new evidence that we need to do something else so I suggest that we submit a PR that declares https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/logging_trace_context.md "Stable" and closes this issue. This marks the specification for using `trace_id`, `span_id`, and `trace_flags` in non-OTLP logging formats stable.
1 parent 3efed53 commit 9d4acd9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ release.
2626

2727
### Compatibility
2828

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

3134
### Common

specification/compatibility/logging_trace_context.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Trace Context in non-OTLP Log Formats
22

3-
**Status**: [Development](../document-status.md)
3+
**Status**: [Stable](../document-status.md)
44

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

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

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

4141
```
42-
[opentelemetry trace_id="102981ABCD2901" span_id="abcdef1010" trace_flags="01"]
42+
[opentelemetry trace_id="102981abcd2901" span_id="abcdef1010" trace_flags="01"]
4343
```
4444

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

5050
```
51-
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
51+
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
5252
```
5353

5454
### JSON Formats
@@ -59,7 +59,7 @@ The fields SHOULD be recorded as top-level fields in the JSON structure. For exa
5959
{
6060
"timestamp":1581385157.14429,
6161
"body":"Incoming request",
62-
"trace_id":"102981ABCD2901",
62+
"trace_id":"102981abcd2901",
6363
"span_id":"abcdef1010"
6464
}
6565
```

0 commit comments

Comments
 (0)