EDR Content
Introduction
The OCS generates EDRs for every event that is processed by the OCS that may be of relevance for reporting or auditing. This includes financial actions such as the use of funds or the crediting of a wallet, along with changes to accounts through automated or manual events/actions, and changes made to OCS service data such as the creation or removal of policies.
See each sub-page of this documentation for further datails.
EDR Writers
The OCS uses the JSLEE EDR Writer subsystem, and has access to all the EDR writing methods published by the JSLEE.
The EDR writer is configured in the same way as other JSLEE verticles, by
using the edr
JSON hash inside the OCS service’s configuration:
{
...
"applications": {
...
"ocs": {
...
"configuration": {
...
"edr": {
"enabled": true,
"store-via": "nz.co.nsquared.slee.edr.storage.RedisEdrStorageService",
"connection": {
"endpoint": "redis://redis-server1"
},
"sink-list": "edr"
}
}
}
}
}
Format
All EDRs generated by the OCS use the common JSLEE EDR format with several additional fields. The following is the basic structure of OCS EDRs:
{
"type": "audit",
"node-name": "marc",
"event-timestamp": "2023-03-25T19:06:57.191200800Z",
"correlation-info": {
"slee-session-id": "fa32f6ef-edcb-42e4-8e2f-f3232bf7ea82",
"slee-event-id": "1",
"ocs-inner-intent": {
"intention": "RESOURCE_INSERT",
"resource-path": "account"
}
},
"source-info": {
"source-service": "localhost:54695",
"source-system": "n2ocs",
"source-endpoint": "localhost:10800",
"source-subsystem": "http-api"
},
"http-info": {
"http-method": "POST",
"tcp-address-local": "127.0.0.1:10800",
"tcp-address-remote": "127.0.0.1:54695",
"http-host": "localhost:10800"
},
"status-message": null,
"status-code": 200,
// OCS EDR specific content
}
The standard EDR fields include the following:
Field | Type | Presence | Description |
---|---|---|---|
type |
String | Always | The type of the EDR. One of “audit”, “bucket-zero”. |
node-name |
String | Always | The server-name configured on the creating node. |
event-timestamp |
Timestamp | Always | The time (in UTC) that the event that triggered the EDR occurred. |
correlation-info |
Object | Always | A grouped field containing correlation information to match EDRs together for a given event. |
source-info |
Object | Always | A grouped field containing source information for the entity and event that created this EDR. |
status-message |
String | Always | Free-form text describing the outcome of the EDR, set by the creating service. |
status-code |
Number | Always | A numeric code indicating success (200) or an error. Error codes differ by EDR type. |
Correlation Information
The correlation information field (under the key correlation-info
) holds
information for the correlation of EDRs with each other and with external
elements. All EDRs for a given triggering event will share the same
slee-session-id
value and will have distinct slee-event-id
values.
Clients that trigger the OCS may reuse the same session ID between requests to the OCS - e.g. a Diameter session ID will be used to tie the session to the OCS debits across the entire session.
Field | Type | Presence | Description |
---|---|---|---|
slee-session-id |
String | Always | Contains the session ID of the session that generated the EDR. |
slee-event-id |
String | Always | Contains a generated event ID that may be used within the session to order EDRs. |
ocs-inner-intent |
Object | Always | Contains OCS-specific information about the session. |
ocs-inner-intent.intention |
String | Always | Defines why the EDR was generated. For multi-event actions the same session ID might be used for multiple actions which are otherwise difficult to tie together. The intention field helps to group EDR fields. |
ocs-inner-intent.resource-path |
String | Always | Defines the API path (which maps closely to the URL path when using the API) that triggered the event. |
Source Information
The source information field (under the key source-info
) holds additional information on the source of a generated EDR.
Field | Type | Presence | Description |
---|---|---|---|
source-service |
String | Always | Holds the configured name of the JSLEE service that triggered the request to the OCS to generate the EDR. |
source-endpoint |
String | Always | If the EDR was generated by a HTTP event, this will be the hostname & port which received the request. If the EDR was generated by another JSLEE verticle the endpoint will be from that source. |
source-system |
String | Always | Always set to n2ocs . |
source-subsystem |
String | Always | Either engine for lifecycle processing triggered by account load, slee-api for any request triggered by the JSLEE API, http-api for any request triggered over the OCS’s HTTP API. |