EDR Messages

Introduction

Support for EDR-… messages is coded into the base Application class. It should not be necessary for any application to explicitly implement support for these messages.

The single currently supported internal EDR-… message is:

Note that this is not a priority administration message, it does not begin with the special ! character, and so it uses the standard user-level queue, it is not passed in the high-priority administration queue.

EDR-LOG

The EDR-LOG message is sent by an application to request the logging of an EDR within an EDR file stream. The stream identifier is provided in the log request.

For each “stream” identifier, a single EDR file will be in progress at any time. In a load-sharing multi-process deployment, this allows for multiple applications to merge their EDRs into a single stream, which facilitates the searching and management of EDR files.

The attributes of the EDR-LOG message are:

Field Type Description
stream String [a-zA-Z0-9_]+ The key for the EDR stream.
EDRs with the same stream will be interleaved together within the same files.
The stream forms part of the EDR filename on-disk.
The EDR application uses the stream to determine file max size/age and in-memory buffering parameters.
The first character must be [a-zA-Z] and subsequent chars [a-zA-Z0-9_].
(Default = n2svcd)
at Array/TimeVal [Required] The second and microsecond timestamp for the nominal "Event" time associated with this EDR.
instance_gids Array of String List of globally-unique instance IDX of the instances which generated this EDR from first to last.
Each string has the format <app_name>-<app_epoch>-<instance_idx> as described below.
The first element in the array is the originating instance GID.
The final element in the array is the GID of the instance which generated the EDR.
event String [a-zA-Z0-9_-]+ [Required] An event type identifier which defines the nature of the Event which occurred, and identifies which fields are expected to be found within the details.
The first character must be [a-zA-Z] and subsequent chars [a-zA-Z0-9_-].
fields Object Free-form field details Object.
The first character of the attribute keys of the fields Object must be [a-zA-Z], and subsequent chars [a-zA-Z0-9_].
The attribute values must be either Scalar, or Array of Scalar.
(Default = No detail fields are recorded)

Note that there is no acknowledgement or response message for an EDR-LOG message, and no correlation with any previously sent IPC message. Hence there is no need for the sender to define either the top-level content or sender_context attributes in the IPC message API layer.

Instance Global ID

The globally-unique instance ID is a four-part string value separated by the tilde character ~.

E.g.: scp-prod-01~IVR~1644801765~6e524136.

In this case the fields are:

The fields are:

nodename String [Required] The name of the node on which n2svcd is running.
This is the value configured for the node name in the `n2svcd.xml`.
app_name String [Required] The name of the application which owns the instance.
This name follows the n2svcd application configuration rules. It must consist of one or more characters from [a-zA-Z0-9 _\-], followed optionally (in the case where repeat is used to share process load) by an optional colon character and repeat number :[0-9]+.
app_epoch Integer [Required] The epoch time at which the application started execution (not the instance).
instance_idx Hexadecimal [Required] The instance's index in hexadecimal (lower-case) format.
This is unique for any pair of app_name and app_epoch.