Submit a request
Submit a request

Using Amazon Kinesis Data Firehose to Stream Session Events and Scores

Please note: this is a premium feature, and may not be included in your product license. If you need more information, please reach out to your Learnosity Account Manager.
 
This article explains the Firehose push service of Data API.
 
The Data API Firehose service is provided as an alternative to integrating with Data API directly. It allows session data to be pushed into your system in near-real time using Amazon Kinesis.
 
Listed below are the types of data that can be configured to be sent to your Kinesis stream.
 

When a session is submitted, a copy of Data API's GET /sessions/statuses payload for that session will be sent to your Kinesis stream as a single message. If the session is submitted multiple times, the message will be sent each time.

Example of a single Kinesis message

{
"user_id": "$ANONYMIZED_USER_ID",
"activity_id": "activity_1234567890",
"num_attempted": 9,
"num_questions": 10,
"session_id": "f4e854f4-3324-4395-beec-1650b522007a",
"session_duration": 8,
"status": "Completed",
"dt_started": "2020-02-17T15:03:23Z",
"dt_completed": "2020-02-17T15:11:43Z"
}

When a session is submitted and has been scored by Learnosity, a copy of Data API's GET /sessions/scores payload will be sent to your Kinesis stream as a single message. If there are any updates or changes to the results for that session, a further Kinesis message will be sent reflecting the latest data.

Example of a single Kinesis message

{
"user_id": "$ANONYMIZED_USER_ID",
"activity_id": "activity_1234567890",
"session_id": "f4e854f4-3324-4395-beec-1650b522007a",
"score": 9,
"max_score": 10,
"subscores": [
{
"id": "subscore-1",
"title": "Informational Text",
"num_questions": 5,
"num_attempted": 4,
"score": 4,
"max_score": 5,
"attempted_max_score": 4,
"items": [
"293486384",
"293481468",
"293475858",
"293475234",
"292922805"
]
}
],
"status": "Completed"
}

 

Session events

The following events can be configured to be pushed to your Kinesis stream. The Kinesis message will contain the name of the event, the metadata related to the session, as well as the time of the event.

  • session-started: The user started a session.
  • session-resumed: The user resumed a previously saved session.
  • session-completed: The user completed a session.

In rare cases, it is possible that events are not sent in chronological order. It is also possible that the same event can be sent more than once. Your system should allow for these scenarios.

Note: Session events are currently only supported with Items API in assess mode, with Assess API v2.32.0 and Questions API v2.68.0 or later.

Example of a single Kinesis message

{
"event": "session-started",
"session_id": "f4e854f4-3324-4395-beec-1650b522007a",
"activity_id": "activity_1234567890",
"user_id": "$ANONYMIZED_USER_ID",
"time": "2020-02-17 15:03:23"
}

 

Limitations

  • Learnosity Firehose pushes data to an AWS Kinesis data stream only. Learnosity Firehose is not compatible with the Kinesis Firehose delivery streams offered by AWS.

  • Your Kinesis data stream must be created in the same AWS region as your Learnosity consumer data. See the list of Learnosity's available regions.

    • You can confirm the region of your specific consumer key(s) in the consumer management area of console.learnosity.com.

    • If you need the Firehose data in another region of AWS, you can co-locate the Kinesis data stream alongside your Learnosity consumer data, then read the Kinesis stream from applications in the other region.
  • Learnosity selects the user_id of your sessions as the Partition Key for your Kinesis stream, so all data for a single user will be sent through the same Kinesis shard. This may be relevant to designing your sharding or ingestion process.

 

Was this article helpful?
1 out of 2 found this helpful

Did you arrive here by accident? If so, learn more about Learnosity by clicking here.