以非 OTLP 日志格式跟踪上下文¶
Status: Experimental
Table of Contents
- [Overview](#overview) - [Syslog RFC5424](#syslog-rfc5424) - [Plain Text Formats](#plain-text-formats) - [JSON Formats](#json-formats) - [Other Structured Formats](#other-structured-formats)Overview¶
OTLP Logs Records have top level fields representing trace context. 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, hex-encoded.
- "span_id" for SpanId, hex-encoded.
- "trace_flags" for trace flags, formatted according to W3C traceflags format.
All 3 fields are optional (see the data model for details of which combination of fields is considered valid).
Syslog RFC5424¶
Trace id, span id and traceflags SHOULD be recorded via SD-ID "opentelemetry".
For example:
Plain Text Formats¶
The fields SHOULD be recorded according to the customary approach used for a particular format (e.g. field:value format for LTSV). For example:
JSON Formats¶
The fields SHOULD be recorded as top-level fields in the JSON structure. For example:
Other Structured Formats¶
The fields SHOULD be recorded as top-level structured attributes of the log record as it is customary for the particular format.