-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(rtcstats): add rtcstats support #2116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
4da5bc5
4d59ce5
c49c48d
2a0537a
23569d4
3b3c29b
6c58f55
ce720cd
02d7a15
7390ead
3d46b41
2a58a67
2d1abff
321364a
c9510de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| services: | ||
|
|
||
| rtcstats-server: | ||
| image: jitsi/rtcstats-server | ||
| restart: ${RESTART_POLICY:-unless-stopped} | ||
| env_file: | ||
| - ./rtcstats/.env | ||
| - ./rtcstats/rtcstats-server/.env | ||
| networks: | ||
| meet.jitsi: | ||
| aliases: | ||
| - rtcstats-server.meet.jitsi | ||
|
|
||
|
|
||
| rtc-visualizer: | ||
| image: jitsi/rtcstats-visualizer | ||
| restart: ${RESTART_POLICY:-unless-stopped} | ||
| volumes: | ||
| - ./rtcstats/rtc-visualizer/.data:/rtc-visualizer/.data | ||
| env_file: | ||
| - ./rtcstats/.env | ||
| - ./rtcstats/rtc-visualizer/.env | ||
| networks: | ||
| meet.jitsi: | ||
| aliases: | ||
| - rtc-visualizer.meet.jitsi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Meeting stats with rtcstats | ||
|
|
||
| ## Overview | ||
|
|
||
| This project demonstrates how to use rtcstats with Jitsi Meet to gather detailed information about meeting quality and logs. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Setup | ||
|
|
||
| 1. **Update Jitsi Meet Docker Compose Configuration** | ||
|
|
||
| Edit `.env` in your `docker-jitsi-meet` directory to enable rtcstats. | ||
| ``` | ||
| # | ||
| # rtcstats integration | ||
| # | ||
|
|
||
| # Enable rtcstats analytics (uncomment to enable) | ||
| RTCSTATS_ENABLED=true | ||
|
|
||
| # Send the console logs to the rtcstats server | ||
| RTCSTATS_STORE_LOGS=false | ||
|
|
||
| # The interval at which rtcstats will poll getStats, defaults to 10000ms. | ||
| RTCSTATS_POLL_INTERVAL=10000 | ||
|
|
||
| # Send the SDP to the rtcstats server | ||
| RTCSTATS_SEND_SDP=true | ||
|
|
||
| ``` | ||
|
|
||
| 2. **Configure rtcstats** | ||
|
|
||
| Copy the example environment files and edit them according to your environment. | ||
| ```shell | ||
| docker-jitsi-meet/rtcstats$ cp env.example .env | ||
| docker-jitsi-meet/rtcstats$ cp ./rtcstats-server/env.example ./rtcstats-server/.env | ||
| docker-jitsi-meet/rtcstats$ cp ./rtc-visualizer/env.example ./rtc-visualizer/.env | ||
| ``` | ||
|
|
||
| Next, edit `rtc-visualizer/.data/users.json` to add your users. The default credential is `admin:admin`. | ||
| ```json | ||
| { | ||
| "Alice": "XXX", | ||
| "Bob": "YYY" | ||
| } | ||
| ``` | ||
|
|
||
| 4. **Run Docker Compose** | ||
|
|
||
| From your `docker-jitsi-meet` directory, run the following command to start all services. | ||
| ```shell | ||
| docker-compose -f docker-compose.yml -f rtcstats.yml up -d | ||
| ``` | ||
|
|
||
|
|
||
| ## Usage | ||
|
|
||
| 1. **View RTC Visualizer** | ||
|
|
||
| Open [https://localhost:8443/rtc-visualizer](https://localhost:8443/rtc-visualizer) (or `PUBLIC_URL/rtc-visualizer`) in your browser. | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # For AWS credentials | ||
| AWS_ACCESS_KEY_ID= | ||
| AWS_SECRET_ACCESS_KEY= | ||
| AWS_REGION= | ||
|
|
||
| # For local S3 and DynamoDB | ||
| RTCSTATS_S3_ENDPOINT= | ||
| RTCSTATS_DYNAMODB_ENDPOINT= | ||
|
|
||
| # DynamoDB Table for rtcstats | ||
| RTCSTATS_METADATA_TABLE=rtcstats-meta-table-local | ||
|
|
||
| # S3 Bucket for rtcstats | ||
| RTCSTATS_S3_BUCKET=jitsi-micros-rtcstats-server |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| volume/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ## Using Localstack | ||
|
|
||
| This section describes how to use Localstack to test and verify your rtcstats setup. Localstack simulates AWS cloud services (like S3) on your local machine, allowing you to confirm that statistics are being saved correctly without needing an actual AWS account. | ||
|
|
||
| ### Setup | ||
|
|
||
|
|
||
| 1. **Configure Network Alias for Custom S3 Bucket** | ||
|
|
||
| If you are using a custom S3 bucket name, you must add it as a network alias in `localstack.yml`. This allows the rtcstats-server and rtc-visualizer to resolve the bucket's address to the Localstack container. | ||
|
|
||
| Edit the `networks` section for the `localstack` service in `rtcstats/localstack/localstack.yml`: | ||
| ```yml | ||
| services: | ||
|
|
||
| localstack: | ||
| # ... (other settings) | ||
| networks: | ||
| meet.jitsi: | ||
| aliases: | ||
| - localhost.localstack.cloud | ||
| # - jitsi-micros-rtcstats-server.s3.localhost.localstack.cloud # Default example | ||
| - YOUR_RTCSTATS_S3_BUCKET.localhost.localstack.cloud | ||
| ``` | ||
| **Note:** Replace `YOUR_RTCSTATS_S3_BUCKET` with the actual bucket name you defined in your environment variables. | ||
|
|
||
|
|
||
| 2. **Run Docker Compose with Localstack** | ||
|
|
||
| From your `docker-jitsi-meet` directory, run the following command to start all services, including Jitsi Meet, rtcstats, and Localstack. | ||
| ```shell | ||
| docker-compose -f docker-compose.yml -f rtcstats.yml -f ./rtcstats/localstack/localstack.yml up -d | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| services: | ||
|
|
||
| rtcstats-setup: | ||
| image: jitsi/rtcstats-server | ||
| env_file: | ||
| - ./rtcstats/.env | ||
| entrypoint: /bin/sh | ||
| command: > | ||
| -c ' | ||
| node ./infra-samples/aws/create-dynamodb-table.js && | ||
| node ./infra-samples/aws/create-s3-bucket.js | ||
| ' | ||
| networks: | ||
| meet.jitsi: | ||
| depends_on: | ||
| - localstack | ||
|
|
||
|
|
||
| localstack: | ||
| container_name: localstack | ||
| image: localstack/localstack | ||
| ports: | ||
| - 4566:4566 | ||
| - 4510-4559:4510-4559 | ||
| env_file: | ||
| - ./rtcstats/.env | ||
| environment: | ||
| # LocalStack configuration: https://docs.localstack.cloud/references/configuration/ | ||
| - SERVICES=lambda,iam,logs,s3,dynamodb,firehose | ||
|
||
| - DEBUG=${DEBUG:-1} | ||
| - AWS_ACCESS_KEY_ID=dummy | ||
| - AWS_SECRET_ACCESS_KEY=dummy | ||
| - AWS_DEFAULT_REGION=us-east-1 | ||
| - AWS_DEFAULT_OUTPUT=json | ||
| - AWS_ENDPOINT_URL=http://localhost.localstack.cloud:4566 | ||
| volumes: | ||
| - "./rtcstats/localstack/${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack" | ||
| - "/var/run/docker.sock:/var/run/docker.sock" | ||
|
||
| networks: | ||
| meet.jitsi: | ||
| aliases: | ||
| - localhost.localstack.cloud | ||
|
||
| - jitsi-micros-rtcstats-server.s3.localhost.localstack.cloud | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "admin": "admin" | ||
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # rtc-visualizer | ||
| #RTCSTATS_FILES_ENDPOINT= | ||
| #RTCSTATS_JWT_PUBLIC_KEY= | ||
| #RTCSTATS_JWT_EGHT_PUBLIC_KEY= | ||
| USERS_FILE=.data/users.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # rtcstats-server: server config | ||
| #RTCSTATS_LOG_LEVEL | ||
| #RTCSTATS_ENVIRONMENT | ||
| #RTCSTATS_KEYPATH=./certs/key.pem | ||
| #RTCSTATS_CERTPATH=./certs/cert.pem | ||
| #RTCSTATS_TEMPPATH=temp | ||
| RTCSTATS_HTTPS=false | ||
| #RTCSTATS_SKIP_LOAD_BALANCER_IP | ||
| #RTCSTATS_JSON_CONSOLE_LOG | ||
|
|
||
| # rtcstats-server: amplitude | ||
| # RTCSTATS_AMPLITUDE_KEY= | ||
|
|
||
| # rtcstats-server: firehose | ||
| #RTCSTATS_FIREHOSE_AWS_REGION | ||
| #RTCSTATS_FIREHOSE_MEETING_STREAM | ||
| #RTCSTATS_FIREHOSE_PC_STREAM | ||
| #RTCSTATS_FIREHOSE_TRACKS_STREAM | ||
| #RTCSTATS_FIREHOSE_E2E_PING_STREAM | ||
| #RTCSTATS_FIREHOSE_FACE_LANDMARKS_STREAM | ||
| #RTCSTATS_FIREHOSE_MEETING_EVENT_STREAM | ||
|
|
||
| # rtcstats-server: s3 | ||
| #RTCSTATS_S3_ACCESSKEYID | ||
| #RTCSTATS_S3_SECRETACCESSKEY | ||
| RTCSTATS_S3_AWS_REGION=us-east-1 | ||
| RTCSTATS_S3_USEIAMAUTH=true | ||
| #RTCSTATS_S3_SIGNEDLINKEXPIRATIONSEC | ||
|
|
||
| # rtcstats-server: webhooks | ||
| #RTCSTATS_WEBHOOK_ENDPOINT | ||
| #RTCSTATS_JWT_AUDIENCE | ||
| #RTCSTATS_JWT_ISSUER | ||
|
|
||
| # rtcstats-server: secretmanager | ||
| #RTCSTATS_AWS_SECRET_REGION | ||
| #RTCSTATS_JWT_SECRET_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this file, RTCSTATS_ENABLED and RTCSTATS_SEND_SDP are both set "true" so when you uncomment them they will be turned on. But RTCSTATS_STORE_LOGS is "false" so if you uncomment it, it won't change anything. I think that this is because you are showing common defaults but the inconsistency seems a little strange to me because the rest of this example file seems to show how to turn things on.