Skip to main content
Explore the OpenTelemetry (OTel) logs data model and how it standardizes diverse log formats into a consistent schema suitable for indexing, querying, and correlating with traces and metrics. Logs arrive in many formats: syslog from operating systems and network devices, web server access logs in Common Log Format (CLF), and proprietary application logs. The OTel logs data model provides a unified schema to represent log records from third-party systems (Nginx, Apache), system logs (syslog), and first-party application instrumentation so that downstream tools and platforms can interpret them consistently.
A presentation slide titled "Logs Data Model – Overview" showing a central box labeled "Logs Data Model" with "Unified schema for log records." Below are three numbered log sources: 1) System (Syslog), 2) Third-party (NGINX), and 3) First-party (custom app).
Why a unified logs schema? The logs data model defines what a log record is: a small set of typed core fields plus an extensible attributes map. This shared definition standardizes how timestamps, severity, and message content are captured and transferred, reducing ambiguity and improving interoperability between collectors, exporters, and observability backends.
A presentation slide titled "Why the Logs Data Model Exists" showing four bullet points explaining its purposes: to establish a shared log record definition, define essential data to capture and transfer, ensure consistent storage and processing, and enable uniform interpretation across logging systems and tools. The slide has a rounded info box with orange dot icons and a Copyright KodeKloud mark.
Events in OpenTelemetry logs OpenTelemetry treats some log records as structured “events” using semantic conventions borrowed from span events. An event-style log record exposes predictable fields such as timestamp, severity, body, and resource identifiers. When you emit logs as events from new instrumentation, you gain consistent indexing, improved filtering, and stronger trace-log correlation. Example of an event-style log record:
Design guidance:
  • Prefer emitting structured, event-style logs for new instrumentation.
  • Legacy logs can remain unmodified, but structured events provide better machine-readability and enable richer analysis.
A presentation slide titled "Understanding Events in OTel Logs" showing an "Events" box listing fields (Timestamp, Severity, Body, Resource identifiers) on the left and numbered points on the right (Structured LogRecords, Predefined fields, Consistency, Optional for legacy).
Logical structure of an OTel log record An OTel log record combines:
  • A compact set of typed, named fields (for consistent querying and correlation).
  • A flexible attributes map and resource attributes for environment-specific key-value context.
Core named fields (common and typed): Mapped fields:
  • attributes and resource attributes: arbitrary key/value pairs (host, pod name, container ID, process ID, etc.). These provide context but are less strictly typed and may vary across sources.
A syslog example mapped into the OTel schema:
Key recommendation: be deliberate when naming attribute keys to reduce ambiguity and improve queryability across heterogeneous log sources.
A slide titled "Logical Structure of a Log and Event Record" showing a two-column table of log field names (Timestamp, ObservedTimestamp, TraceId, SpanId, TraceFlags, SeverityText, etc.) and short descriptions for each. The image appears to be a KodeKloud copyright slide.
Timestamps and severity numbers OpenTelemetry represents timestamps as 64-bit unsigned integers (nanoseconds since the Unix epoch) and captures both the original event time and when the Collector observed it. Example timestamps (nanoseconds since epoch):
Severity is represented as both text and a numeric severity number. Numeric ranges map to categories as follows: When exporting to systems that don’t support the exact numeric level, OTel exporters typically select the nearest supported severity.
A color-coded "SeverityNumber Mapping Table" showing severity ranges (1–24) mapped to categories like TRACE, DEBUG, INFO, WARN, ERROR, and FATAL with short meanings for each. The table explains what each level signifies (e.g., debugging events, warnings, errors, fatal crashes).
Mapping, exporters, and efficiency The logs data model is designed to map raw logs into OTel’s schema and then export them in target formats (OTLP, JSON, etc.) with minimal semantic loss. When a direct mapping is impossible (e.g., non-matching severity models), select the nearest compatible value. Best practices for efficient transport and processing:
  • Use Protobuf encoding for OTLP for compact, performant transport.
  • Batch shared metadata (resource attributes and instrumentation scope) so identical metadata is sent once per batch instead of repeated for each log record. This is especially important for high-throughput environments like Kubernetes pods.
  • Prefer structured event-style logs to make downstream indexing, filtering, and correlation more efficient.
A presentation slide titled "Mapping, Reverse Mapping, and Efficiency" showing a flowchart from Raw Logs → OTel Schema → Exporter Formats (JSON/OTLP/others). Colored callout boxes list optimizations like "Severity mismatch" (map to nearest severity number), "Protobuf" (encoding for OTLP), and "Batch resource & Scope metadata" (reduce overhead).
When designing instrumentation, prefer structured event-style logs (with timestamp, severity, body, and resource identifiers). This improves filtering, correlation with traces, and consistency across diverse log sources.
Links and references

Watch Video