Service: Player Analytics Worker - EyevinnOSC/community GitHub Wiki

Getting Started

The Eyevinn Player Analytics Specification (EPAS) is an open source and open standard for video player analytics. The Player Analytics Worker picks up events written to an SQS queue by the Player Analytics Eventsink and writes them to a ClickHouse Server for further processing according to EPAS. This worker is available as an open web service in Eyevinn Open Source Cloud and this guide will walk you through how to get started.

Prerequisites

Step 1: Setup a Player Analytics Eventsink

The eventsink pushes events it receives on to an SQS queue ready for the worker to pick up. This guide will walk you through how to setup the Eventsink and the SQS queue.

Step 2: Setup a ClickHouse Server

The worker writes the events to a database for further processing. We will use the open web service ClickHouse Server in Eyevinn Open Source Cloud that provides lightning-fast, open-source columnar database. Navigate to the ClickHouse Server in Eyevinn Open Source Cloud web console. Press the button "Create clickhouse-server".

We give the instance the name eventsink and Db event_db and User event_db_user and Password event_db_secret. We recommend to use stronger credentials stored as service secrets that are referenced instead.

We are now ready to create the Player Analytics Worker so it can store data from the queue into the database. It will create the database if it is missing.

Step 4: Setting up the Player Analytics Worker

The Worker fetches events from the eventsink and stores them in the database for further processing. This means that it both has to communicate with the SQS as well as the ClickHouse Server. Click the Create worker button to configure the Worker. (Note: in order of displaying the data as clear as possible, below we display the Instance parameters when we already have entered all the data.)

Screenshot 2025-03-12 at 01 05 54

Name is your name for the worker, here set to testingplayeranalyticsworker. To get the ClickHouseUrl you have to click the three dots on the card of your ClickHouse Server Instance, and then click Copy URL. You will then get the url to your ClickHouse Server Instance:

https://eyevinnlab-eventsinker.clickhouse-clickhouse.auto.prod.osaas.io

However we have to modify this in order to use it. We need to enter the User and Password according to this formula: https://User:Password@<rest of url> so it will look like this:

https://`event_db_user`:`event_db_secret`@eyevinnlab-eventsinker.clickhouse-clickhouse.auto.prod.osaas.io

SqsQueueUrl this is the AWS url that identifies the queue. You can get hold of this by sending this query:

AWS_ACCESS_KEY_ID=wiki1test_user AWS_SECRET_ACCESS_KEY=wiki1test_secret AWS_REGION=osc \
aws sqs create-queue --queue-name=events --endpoint-url=https://eyevinnlab-wiki1test.poundifdef-smoothmq.auto.prod.osaas.io
Result:
https://sqs.us-east-1.amazonaws.com/1/events

NOTE: in the sample above the queue has the name wiki1test, the AccessKey is wiki1test_user, and the SecretKey is wiki1test_secret. These are the values that you setup for the SQS queue in the previous Step 1.

AwsAccessKeyId this is the AccessKey used above and when setting up the SmoothMQ, wiki1test_user. AwsSecretAccessKeythis is the SecretKey used above and when setting up the SmoothMQ, wiki1test_secret. Finally SqsEndpointthis is the URL to the SmoothMQ. To get this you have to click the three dots on the card of your SmoothMQ instance, and then click Copy URL.

Step 5: Reviewing the data

The ClickHouser Server allows you to easily query the data and also create tables. Navigate to the ClickHouse Server in Eyevinn Open Source Cloud web console. Press the button with three dots on the card of your ClickHouse Server instance, and then click Open application.

In the upper right corner of the query pane you have to fill in the User and Password that you created in Step 2.

Screenshot 2025-03-12 at 01 20 38