Skip to content

Latest commit

 

History

History
121 lines (83 loc) · 6.11 KB

logs.md

File metadata and controls

121 lines (83 loc) · 6.11 KB

General Logs Attributes

Status: Experimental

The attributes described in this section are rather generic. They may be used in any Log Record they apply to.

The following semantic conventions for logs are defined:

  • General: General semantic attributes that may be used in describing Log Records.
  • Exceptions: Semantic attributes that may be used in describing exceptions in logs.
  • Feature Flags: Semantic attributes that may be used in describing feature flag evaluations in logs.

Apart from semantic conventions for logs, events, traces, and metrics, OpenTelemetry also defines the concept of overarching Resources with their own Resource Semantic Conventions.

General log identification attributes

These attributes may be used for identifying a Log Record.

Attribute Type Description Examples Requirement Level Stability
log.record.uid string A unique identifier for the Log Record. [1] 01ARZ3NDEKTSV4RRFFQ69G5FAV Opt-In Experimental

[1]: If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values. The id MAY be an Universally Unique Lexicographically Sortable Identifier (ULID), but other identifiers (e.g. UUID) may be used as needed.

Log Media

This section describes attributes for log media in OpenTelemetry. Log media are mechanisms by which logs are transmitted. Types of media include files, streams, network protocols, and os-specific logging services such as journald and Windows Event Log.

Note: The OpenTelemetry specification defines a Resource as an immutable representation of the entity producing telemetry. The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission. As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes.

Log File

Description: A file to which log was emitted.

Attribute Type Description Examples Requirement Level Stability
log.file.name string The basename of the file. audit.log Recommended Experimental
log.file.name_resolved string The basename of the file, with symlinks resolved. uuid.log Opt-In Experimental
log.file.path string The full path to the file. /var/log/mysql/audit.log Opt-In Experimental
log.file.path_resolved string The full path to the file, with symlinks resolved. /var/lib/docker/uuid.log Opt-In Experimental

I/O Stream

Description: The I/O stream to which the log was emitted.

Attribute Type Description Examples Requirement Level Stability
log.iostream string The stream associated with the log. See below for a list of well-known values. stdout; stderr Opt-In Experimental

log.iostream has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
stderr Events from stderr stream Experimental
stdout Logs from stdout stream Experimental