Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.99 KB

File metadata and controls

69 lines (45 loc) · 1.99 KB

Events API Interface

Status: Experimental

Table of Contents

The Event API offers convenience methods for emitting LogRecords that conform to the semantic conventions for Events.

EventLogger

The EventLogger is the entrypoint of the Event API, and is responsible for emitting Events as LogRecords.

EventLogger Operations

The EventLogger MUST provide functions to:

Create EventLogger

New EventLogger instances are created though a constructor or factory method on EventLogger.

Parameters:

  • logger - the delegate Logger used to emit Events as LogRecords.
  • event_domain - the domain of emitted events, used to set the event.domain attribute.

Emit Event

Emit a LogRecord representing an Event to the delegate Logger.

This function MAY be named logEvent.

Parameters:

  • event_name - the Event name. This argument MUST be recorded as a LogRecord attribute with the key event.name. Care MUST be taken by the implementation to not override or delete this attribute while the Event is emitted to preserve its identity.
  • logRecord - the LogRecord representing the Event.

Implementation Requirements:

The implementation MUST emit the logRecord to the logger specified when creating the EventLogger after making the following changes:

  • The event_domain specified when creating the EventLogger MUST be set as the event.domain attribute on the logRecord.
  • The event_name MUST be set as the event.name attribute on the logRecord.