Compare commits

..

No commits in common. "main" and "1.1.2" have entirely different histories.
main ... 1.1.2

18 changed files with 208 additions and 784 deletions

1
.github/CODEOWNERS vendored
View file

@ -1 +0,0 @@
* @0x46616c6b

View file

@ -1,34 +0,0 @@
---
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "09:00"
timezone: "Europe/Berlin"
groups:
gomod:
patterns:
- "*"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "09:00"
timezone: "Europe/Berlin"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "09:00"
timezone: "Europe/Berlin"
groups:
github-actions:
patterns:
- "*"

View file

@ -1,41 +0,0 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧹 Maintenance'
labels:
- 'chore'
- 'dependencies'
version-resolver:
major:
labels:
- 'feature'
minor:
labels:
- 'enhancement'
patch:
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'chore'
- 'dependencies'
default: patch
template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
## Docker
- `docker pull systemli/prometheus-jitsi-meet-exporter:$RESOLVED_VERSION`

View file

@ -1,85 +1,38 @@
name: Integration name: Integration
on: on: [push]
push:
branches:
- main
pull_request:
jobs: jobs:
test: test:
name: Test name: Test
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- name: Setup go - name: Setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v1
with: with:
go-version: "1.17.x" go-version: '1.14.x'
- name: Cache Go Dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Vet - name: Vet
run: go vet run: make vet
- name: Test - name: Test
run: go test ./... run: make coverage
build: build:
name: Build name: Build
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
needs:
- test
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- name: Setup go - name: Setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v1
with: with:
go-version: "1.17.x" go-version: '1.14.x'
- name: Cache Go Dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build - name: Build
run: go build ./... run: make build
- name: Docker
run: docker build .
automerge:
name: Merge Automatically
needs: [test, build]
runs-on: ubuntu-20.04
permissions:
pull-requests: write
contents: write
docker:
name: Docker
runs-on: ubuntu-latest
steps: steps:
- name: Obtain Access Token - uses: actions/checkout@v2
id: acces_token - name: Docker
run: | run: make docker
TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.SYSTEMLI_APP_CREDENTIALS_TOKEN }})"
echo "token=$TOKEN" >> $GITHUB_OUTPUT
- name: Merge
uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ steps.acces_token.outputs.token }}

View file

@ -1,16 +1,16 @@
name: Quality name: Quality
on: on: [push]
push:
branches:
- main
pull_request:
jobs: jobs:
golangci: golangci:
name: GolangCI name: GolangCI
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- name: GolangCI - name: GolangCI
uses: golangci/golangci-lint-action@v3 uses: Mushus/golangci-lint-action@master
with:
config: .golangci.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,18 +0,0 @@
name: Release Drafter
on:
push:
branches:
- main
jobs:
release:
name: Update Release
runs-on: ubuntu-20.04
steps:
- name: Publish Release
uses: release-drafter/release-drafter@v5
with:
publish: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,42 +1,71 @@
name: Release name: Release
on: on:
release: push:
types: [published] tags:
- '*'
jobs: jobs:
release: release:
name: Release name: Release
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup go - name: Setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v1
with: with:
go-version: "1.17.x" go-version: '1.14.x'
- name: Create release artifacts
- name: Cache Go Dependencies run: make release
uses: actions/cache@v4 env:
with: GOPATH: ${{ github.workspace }}/go
path: | - name: Create Github Release
~/.cache/go-build id: create_release
~/go/pkg/mod uses: actions/create-release@v1
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Login to Docker Hub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Releases
uses: goreleaser/goreleaser-action@v5.0.0
with:
version: latest
args: release --rm-dist
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release artifacts (Mac OS amd64)
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/prometheus-jitsi-meet-exporter-darwin-amd64
asset_name: prometheus-jitsi-meet-exporter-darwin-amd64
asset_content_type: application/octet-stream
- name: Upload release artifacts (FreeBSD amd64)
id: upload-release-asset-freebsd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/prometheus-jitsi-meet-exporter-freebsd-amd64
asset_name: prometheus-jitsi-meet-exporter-freebsd-amd64
asset_content_type: application/octet-stream
- name: Upload release artifacts (Linux amd64)
id: upload-release-asset-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/prometheus-jitsi-meet-exporter-linux-amd64
asset_name: prometheus-jitsi-meet-exporter-linux-amd64
asset_content_type: application/octet-stream
- name: Upload release artifacts (shasums)
id: upload-release-asset-sha512sums
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/sha512sums.txt
asset_name: sha512sums.txt
asset_content_type: application/octet-stream

2
.gitignore vendored
View file

@ -1 +1 @@
dist build

View file

@ -1,30 +0,0 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarm:
- "6"
- "7"
ldflags:
- -s -w
dockers:
-
goos: linux
goarch: amd64
image_templates:
- "systemli/prometheus-jitsi-meet-exporter:{{ .Tag }}"
- "systemli/prometheus-jitsi-meet-exporter:{{ .Major }}"
- "systemli/prometheus-jitsi-meet-exporter:{{ .Major }}.{{ .Minor }}"
- "systemli/prometheus-jitsi-meet-exporter:latest"
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
skip: true

View file

@ -1,30 +1,12 @@
# syntax=docker/dockerfile:1 FROM golang:1.14-alpine
ENV GO111MODULE=on
# Build the application from source WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
FROM golang:1.21.4 AS build-stage ADD . /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
RUN go build -o /prometheus-jitsi-meet-exporter
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
# Run the tests in the container FROM alpine
FROM build-stage AS run-test-stage WORKDIR /app
RUN go test -v ./... COPY --from=0 /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
# Deploy the application binary into a lean image
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
EXPOSE 9888 EXPOSE 9888
USER nonroot:nonroot
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"] ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]

44
Makefile Normal file
View file

@ -0,0 +1,44 @@
GOCMD = go
GOBUILD = $(GOCMD) build
GOCLEAN = $(GOCMD) clean
GOTEST = $(GOCMD) test
GOVET = $(GOCMD) vet
GOGET = $(GOCMD) get
GOX = $(GOPATH)/bin/gox
GOGET = $(GOCMD) get
GOX_ARGS = -output="$(BUILD_DIR)/{{.Dir}}-{{.OS}}-{{.Arch}}" -osarch="linux/amd64 darwin/amd64 freebsd/amd64"
BUILD_DIR = build
BINARY_NAME = prometheus-jitsi-meet-exporter
all: clean vet test build
build:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v
vet:
${GOVET} ./...
test:
${GOTEST} ./...
coverage:
${GOTEST} -coverprofile=coverage.txt -covermode=atomic ./...
clean:
$(GOCLEAN)
rm -f $(BUILD_DIR)/*
run: build
./$(BUILD_DIR)/$(BINARY_NAME)
release:
${GOGET} -u github.com/mitchellh/gox
${GOX} -ldflags "${LD_FLAGS}" ${GOX_ARGS}
shasum -a 512 build/* > build/sha512sums.txt
docker:
docker build --rm --force-rm --no-cache -t systemli/prometheus-jitsi-meet-exporter .
.PHONY: all vet test coverage clean build run release docker

View file

@ -1,16 +1,17 @@
# Jitsi Meet Metrics Exporter # Jitsi Meet Metrics Exporter
[![Integration](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Integration/badge.svg?branch=main)](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Integration/badge.svg?branch=main) [![Quality](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Quality/badge.svg?branch=main)](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Quality/badge.svg?branch=main) [![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/systemli/prometheus-jitsi-meet-exporter)](https://hub.docker.com/r/systemli/prometheus-jitsi-meet-exporter) [![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/systemli/prometheus-jitsi-meet-exporter)](https://hub.docker.com/r/systemli/prometheus-jitsi-meet-exporter) ![Integration](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Integration/badge.svg?branch=master) ![Quality](https://github.com/systemli/prometheus-jitsi-meet-exporter/workflows/Quality/badge.svg?branch=master) ![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/systemli/prometheus-jitsi-meet-exporter) ![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/systemli/prometheus-jitsi-meet-exporter)
Prometheus Exporter for Jitsi Meet written in Go. Based on [Jitsi Meet Exporter](https://git.autistici.org/ai3/tools/jitsi-prometheus-exporter) from [Autistici](https://www.autistici.org/) Prometheus Exporter for Jitsi Meet written in Go. Based on [Jitsi Meet Exporter](https://git.autistici.org/ai3/tools/jitsi-prometheus-exporter) from [Autistici](https://www.autistici.org/)
There's multiple different [statistics endpoint that can be exposed by jitsi](https://github.com/jitsi/jitsi-videobridge/blob/master/doc/statistics.md) (like /stats and /colibri/stats); you can configure the used URL with the `videobridge-url`. There's multiple different statistics endpoint that can be exposed by jitsi (like /stats and /colibri/stats); you can configure the used URL with the `videobridge-url`.
The exporter will handle both of them, but some metrics that aren't exposed may be reported as 0. The exporter will handle both of them, but some metrics that aren't exposed may be reported as 0.
## Usage ## Usage
``` ```
go install github.com/systemli/prometheus-jitsi-meet-exporter@latest go get github.com/systemli/prometheus-jitsi-meet-exporter
go install github.com/systemli/prometheus-jitsi-meet-exporter
$GOPATH/bin/prometheus-jitsi-meet-exporter $GOPATH/bin/prometheus-jitsi-meet-exporter
``` ```
@ -29,7 +30,7 @@ Example Playbook:
### Docker ### Docker
``` ```
docker run -p 9888:9888 systemli/prometheus-jitsi-meet-exporter:latest -videobridge-url http://jitsi:8080/colibri/stats docker run -p 9888:9888 systemli/prometheus-jitsi-meet-exporter:latest -videobridge-url http://jitsi:8888/stats
``` ```
## Dashboard ## Dashboard
@ -82,9 +83,6 @@ jitsi_videochannels 0
# HELP jitsi_conferences The current number of conferences. # HELP jitsi_conferences The current number of conferences.
# TYPE jitsi_conferences gauge # TYPE jitsi_conferences gauge
jitsi_conferences 0 jitsi_conferences 0
# HELP jitsi_p2p_conferences The current number of p2p conferences.
# TYPE jitsi_p2p_conferences gauge
jitsi_p2p_conferences 1
# HELP jitsi_participants The current number of participants. # HELP jitsi_participants The current number of participants.
# TYPE jitsi_participants gauge # TYPE jitsi_participants gauge
jitsi_participants 0 jitsi_participants 0
@ -124,42 +122,6 @@ jitsi_total_colibri_web_socket_messages_received 0
# HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets. # HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets.
# TYPE jitsi_total_colibri_web_socket_messages_sent counter # TYPE jitsi_total_colibri_web_socket_messages_sent counter
jitsi_total_colibri_web_socket_messages_sent 0 jitsi_total_colibri_web_socket_messages_sent 0
# HELP jitsi_octo_version The current running OCTO version
# TYPE jitsi_octo_version gauge
jitsi_octo_version 0
# HELP jitsi_octo_conferences The current number of OCTO conferences.
# TYPE jitsi_octo_conferences gauge
jitsi_octo_conferences 0
# HELP jitsi_octo_endpoints The current number of OCTO endpoints.
# TYPE jitsi_octo_endpoints gauge
jitsi_octo_endpoints 0
# HELP jitsi_octo_receive_bitrate The total receiving bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_receive_bitrate gauge
jitsi_octo_receive_bitrate 0
# HELP jitsi_octo_send_bitrate The total outgoing bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_send_bitrate gauge
jitsi_octo_send_bitrate 0
# HELP jitsi_octo_receive_packet_rate The total incoming packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_receive_packet_rate gauge
jitsi_octo_receive_packet_rate 0
# HELP jitsi_octo_send_packet_rate The total outgoing packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_send_packet_rate gauge
jitsi_octo_send_packet_rate 0
# HELP jitsi_total_bytes_received_octo The total incoming bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_received_octo gauge
jitsi_total_bytes_received_octo 0
# HELP jitsi_total_bytes_sent_octo The total outgoing bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_sent_octo gauge
jitsi_total_bytes_sent_octo 0
# HELP jitsi_total_packets_dropped_octo The total of dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_dropped_octo gauge
jitsi_total_packets_dropped_octo 0
# HELP jitsi_total_packets_received_octo The total of incoming dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_received_octo gauge
jitsi_total_packets_received_octo 0
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_sent_octo gauge
jitsi_total_packets_sent_octo 0
``` ```
## License ## License

View file

@ -20,7 +20,7 @@
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "7.3.7" "version": "7.0.0"
}, },
{ {
"type": "panel", "type": "panel",
@ -56,10 +56,10 @@
}, },
"description": "Dashboard for Jitsi Meet Exporter", "description": "Dashboard for Jitsi Meet Exporter",
"editable": true, "editable": true,
"gnetId": 12282, "gnetId": 12098,
"graphTooltip": 1, "graphTooltip": 1,
"id": null, "id": null,
"iteration": 1613598823724, "iteration": 1589881312938,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -135,13 +135,12 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, },
"showThresholdLabels": false, "showThresholdLabels": false,
"showThresholdMarkers": true "showThresholdMarkers": true
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "(((count(count(node_cpu_seconds_total{instance=~\"$instance.*\"}) by (cpu))) - avg(sum by (mode)(irate(node_cpu_seconds_total{mode='idle',instance=~\"$instance.*\"}[5m])))) * 100) / count(count(node_cpu_seconds_total{instance=~\"$instance.*\"}) by (cpu))", "expr": "(((count(count(node_cpu_seconds_total{instance=~\"$instance.*\"}) by (cpu))) - avg(sum by (mode)(irate(node_cpu_seconds_total{mode='idle',instance=~\"$instance.*\"}[5m])))) * 100) / count(count(node_cpu_seconds_total{instance=~\"$instance.*\"}) by (cpu))",
@ -211,13 +210,12 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, },
"showThresholdLabels": false, "showThresholdLabels": false,
"showThresholdMarkers": true "showThresholdMarkers": true
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "((node_memory_MemTotal_bytes{instance=~\"$instance.*\"} - node_memory_MemFree_bytes{instance=~\"$instance.*\"}) / (node_memory_MemTotal_bytes{instance=~\"$instance.*\"} )) * 100", "expr": "((node_memory_MemTotal_bytes{instance=~\"$instance.*\"} - node_memory_MemFree_bytes{instance=~\"$instance.*\"}) / (node_memory_MemTotal_bytes{instance=~\"$instance.*\"} )) * 100",
@ -280,12 +278,10 @@
"calcs": [ "calcs": [
"lastNotNull" "lastNotNull"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "sum(node_network_receive_bytes_total{instance=~\"$instance.*\"})*(9.31*10^-10)", "expr": "sum(node_network_receive_bytes_total{instance=~\"$instance.*\"})*(9.31*10^-10)",
@ -367,12 +363,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_bit_rate_download{instance=~\"$instance.*\"}", "expr": "jitsi_bit_rate_download{instance=~\"$instance.*\"}",
@ -440,12 +434,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_bit_rate_upload{instance=~\"$instance.*\"}", "expr": "jitsi_bit_rate_upload{instance=~\"$instance.*\"}",
@ -513,12 +505,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_threads{instance=~\"$instance.*\"}", "expr": "jitsi_threads{instance=~\"$instance.*\"}",
@ -586,12 +576,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_videostreams{instance=~\"$instance.*\"}", "expr": "jitsi_videostreams{instance=~\"$instance.*\"}",
@ -659,12 +647,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_rtt_aggregate{instance=~\"$instance.*\"}", "expr": "jitsi_rtt_aggregate{instance=~\"$instance.*\"}",
@ -732,12 +718,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_total_conference_seconds{instance=~\"$instance.*\"}", "expr": "jitsi_total_conference_seconds{instance=~\"$instance.*\"}",
@ -805,12 +789,10 @@
"calcs": [ "calcs": [
"max" "max"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "max(jitsi_largest_conference{instance=~\"$instance.*\"})", "expr": "max(jitsi_largest_conference{instance=~\"$instance.*\"})",
@ -878,12 +860,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_total_conferences_created{instance=~\"$instance.*\"}", "expr": "jitsi_total_conferences_created{instance=~\"$instance.*\"}",
@ -907,8 +887,7 @@
"description": "The current number of conferences.", "description": "The current number of conferences.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {}
"links": []
}, },
"overrides": [] "overrides": []
}, },
@ -936,16 +915,15 @@
"linewidth": 1, "linewidth": 1,
"nullPointMode": "null", "nullPointMode": "null",
"options": { "options": {
"alertThreshold": true "dataLinks": []
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.3.7",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
"seriesOverrides": [], "seriesOverrides": [],
"spaceLength": 10, "spaceLength": 10,
"stack": true, "stack": false,
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
@ -953,12 +931,6 @@
"interval": "", "interval": "",
"legendFormat": "conferences", "legendFormat": "conferences",
"refId": "A" "refId": "A"
},
{
"expr": "jitsi_p2p_conferences{instance=~\"$instance.*\"}",
"interval": "",
"legendFormat": "p2p conferences",
"refId": "B"
} }
], ],
"thresholds": [], "thresholds": [],
@ -1012,8 +984,7 @@
"description": "The current number of participants.", "description": "The current number of participants.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {}
"links": []
}, },
"overrides": [] "overrides": []
}, },
@ -1041,10 +1012,9 @@
"linewidth": 1, "linewidth": 1,
"nullPointMode": "null", "nullPointMode": "null",
"options": { "options": {
"alertThreshold": true "dataLinks": []
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.3.7",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -2348,111 +2318,6 @@
"align": false, "align": false,
"alignLevel": null "alignLevel": null
} }
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "Stress Level reported to Jicofo by the videobridge.",
"fieldConfig": {
"defaults": {
"color": {},
"custom": {},
"thresholds": {
"mode": "absolute",
"steps": []
},
"unit": "short"
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 67
},
"hiddenSeries": false,
"id": 51,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.2",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "jitsi_stress_level{instance=~\"$instance.*\"}",
"instant": false,
"interval": "",
"legendFormat": "stress level",
"queryType": "randomWalk",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Videobridge Stress Level",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
} }
], ],
"title": "Additional Metrics", "title": "Additional Metrics",
@ -2460,7 +2325,7 @@
} }
], ],
"refresh": "1m", "refresh": "1m",
"schemaVersion": 26, "schemaVersion": 25,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
"templating": { "templating": {
@ -2470,7 +2335,6 @@
"current": {}, "current": {},
"datasource": "${DS_PROMETHEUS}", "datasource": "${DS_PROMETHEUS}",
"definition": "label_values(jitsi_conferences, instance)", "definition": "label_values(jitsi_conferences, instance)",
"error": null,
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": false,
"label": "instance", "label": "instance",
@ -2510,5 +2374,5 @@
"timezone": "", "timezone": "",
"title": "Jitsi Meet & System", "title": "Jitsi Meet & System",
"uid": "IJXK9Q6Wz", "uid": "IJXK9Q6Wz",
"version": 5 "version": 8
} }

View file

@ -14,7 +14,7 @@
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "7.3.7" "version": "7.0.0"
}, },
{ {
"type": "panel", "type": "panel",
@ -53,7 +53,7 @@
"gnetId": 12098, "gnetId": 12098,
"graphTooltip": 1, "graphTooltip": 1,
"id": null, "id": null,
"iteration": 1612608944252, "iteration": 1589881340817,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -124,12 +124,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_bit_rate_download{instance=~\"$instance.*\"}", "expr": "jitsi_bit_rate_download{instance=~\"$instance.*\"}",
@ -197,12 +195,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_bit_rate_upload{instance=~\"$instance.*\"}", "expr": "jitsi_bit_rate_upload{instance=~\"$instance.*\"}",
@ -270,12 +266,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_threads{instance=~\"$instance.*\"}", "expr": "jitsi_threads{instance=~\"$instance.*\"}",
@ -343,12 +337,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_videostreams{instance=~\"$instance.*\"}", "expr": "jitsi_videostreams{instance=~\"$instance.*\"}",
@ -416,12 +408,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_rtt_aggregate{instance=~\"$instance.*\"}", "expr": "jitsi_rtt_aggregate{instance=~\"$instance.*\"}",
@ -489,12 +479,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_total_conference_seconds{instance=~\"$instance.*\"}", "expr": "jitsi_total_conference_seconds{instance=~\"$instance.*\"}",
@ -562,12 +550,10 @@
"calcs": [ "calcs": [
"max" "max"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "max(jitsi_largest_conference{instance=~\"$instance.*\"})", "expr": "max(jitsi_largest_conference{instance=~\"$instance.*\"})",
@ -635,12 +621,10 @@
"calcs": [ "calcs": [
"last" "last"
], ],
"fields": "",
"values": false "values": false
}, }
"textMode": "auto"
}, },
"pluginVersion": "7.3.7", "pluginVersion": "7.0.0",
"targets": [ "targets": [
{ {
"expr": "jitsi_total_conferences_created{instance=~\"$instance.*\"}", "expr": "jitsi_total_conferences_created{instance=~\"$instance.*\"}",
@ -664,8 +648,7 @@
"description": "The current number of conferences.", "description": "The current number of conferences.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {}
"links": []
}, },
"overrides": [] "overrides": []
}, },
@ -693,16 +676,15 @@
"linewidth": 1, "linewidth": 1,
"nullPointMode": "null", "nullPointMode": "null",
"options": { "options": {
"alertThreshold": true "dataLinks": []
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.3.7",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
"seriesOverrides": [], "seriesOverrides": [],
"spaceLength": 10, "spaceLength": 10,
"stack": true, "stack": false,
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
@ -710,12 +692,6 @@
"interval": "", "interval": "",
"legendFormat": "conferences", "legendFormat": "conferences",
"refId": "A" "refId": "A"
},
{
"expr": "jitsi_p2p_conferences{instance=~\"$instance.*\"}",
"interval": "",
"legendFormat": "p2p conferences",
"refId": "B"
} }
], ],
"thresholds": [], "thresholds": [],
@ -769,8 +745,7 @@
"description": "The current number of participants.", "description": "The current number of participants.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {}, "custom": {}
"links": []
}, },
"overrides": [] "overrides": []
}, },
@ -798,10 +773,9 @@
"linewidth": 1, "linewidth": 1,
"nullPointMode": "null", "nullPointMode": "null",
"options": { "options": {
"alertThreshold": true "dataLinks": []
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.3.7",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -2112,7 +2086,7 @@
} }
], ],
"refresh": "1m", "refresh": "1m",
"schemaVersion": 26, "schemaVersion": 25,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
"templating": { "templating": {
@ -2122,7 +2096,6 @@
"current": {}, "current": {},
"datasource": "${DS_PROMETHEUS}", "datasource": "${DS_PROMETHEUS}",
"definition": "label_values(jitsi_conferences, instance)", "definition": "label_values(jitsi_conferences, instance)",
"error": null,
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": false,
"label": "instance", "label": "instance",
@ -2162,5 +2135,5 @@
"timezone": "", "timezone": "",
"title": "Jitsi Meet", "title": "Jitsi Meet",
"uid": "wX13E8RGz", "uid": "wX13E8RGz",
"version": 3 "version": 4
} }

4
go.mod
View file

@ -1,5 +1,5 @@
module github.com/systemli/prometheus-jitsi-meet-exporter module github.com/systemli/prometheus-jitsi-meet-exporter
go 1.17 go 1.14
require github.com/google/go-cmp v0.6.0 require github.com/google/go-cmp v0.4.0

5
go.sum
View file

@ -1,2 +1,3 @@
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

86
main.go
View file

@ -10,7 +10,7 @@ import (
var ( var (
addr = flag.String("web.listen-address", ":9888", "Address on which to expose metrics and web interface.") addr = flag.String("web.listen-address", ":9888", "Address on which to expose metrics and web interface.")
videoBridgeURL = flag.String("videobridge-url", "http://localhost:8080/colibri/stats", "Jitsi Videobridge /stats URL to scrape") videoBridgeURL = flag.String("videobridge-url", "http://localhost:8888/stats", "Jitsi Videobridge /stats URL to scrape")
) )
type videoBridgeStats struct { type videoBridgeStats struct {
@ -28,10 +28,8 @@ type videoBridgeStats struct {
AudioChannels int `json:"audiochannels"` AudioChannels int `json:"audiochannels"`
VideoChannels int `json:"videochannels"` VideoChannels int `json:"videochannels"`
Conferences int `json:"conferences"` Conferences int `json:"conferences"`
P2PConferences int `json:"p2p_conferences"`
Participants int `json:"participants"` Participants int `json:"participants"`
Videostreams int `json:"videostreams"` Videostreams int `json:"videostreams"`
StressLevel float64 `json:"stress_level"`
TotalLossControlledParticipantSeconds int `json:"total_loss_controlled_participant_seconds"` TotalLossControlledParticipantSeconds int `json:"total_loss_controlled_participant_seconds"`
TotalLossLimitedParticipantSeconds int `json:"total_loss_limited_participant_seconds"` TotalLossLimitedParticipantSeconds int `json:"total_loss_limited_participant_seconds"`
TotalLossDegradedParticipantSeconds int `json:"total_loss_degraded_participant_seconds"` TotalLossDegradedParticipantSeconds int `json:"total_loss_degraded_participant_seconds"`
@ -45,22 +43,6 @@ type videoBridgeStats struct {
TotalColibriWebSocketMessagesReceived int `json:"total_colibri_web_socket_messages_received"` TotalColibriWebSocketMessagesReceived int `json:"total_colibri_web_socket_messages_received"`
TotalColibriWebSocketMessagesSent int `json:"total_colibri_web_socket_messages_sent"` TotalColibriWebSocketMessagesSent int `json:"total_colibri_web_socket_messages_sent"`
TotalParticipants int `json:"total_participants"` TotalParticipants int `json:"total_participants"`
OctoVersion int `json:"octo_version"`
OctoConferences int `json:"octo_conferences"`
OctoEndpoints int `json:"octo_endpoints"`
OctoReceiveBitrate float64 `json:"octo_receive_bitrate"`
OctoReceivePacketRate float64 `json:"octo_receive_packet_rate"`
OctoSendBitrate float64 `json:"octo_send_bitrate"`
OctoSendPacketRate float64 `json:"octo_send_packet_rate"`
TotalBytesReceivedOcto int `json:"total_bytes_received_octo"`
TotalBytesSentOcto int `json:"total_bytes_sent_octo"`
TotalPacketsDroppedOcto int `json:"total_packets_dropped_octo"`
TotalPacketsReceivedOcto int `json:"total_packets_received_octo"`
TotalPacketsSentOcto int `json:"total_packets_sent_octo"`
TotalICESucceededRelayed int `json:"total_ice_succeeded_relayed"`
TotalICESucceeded int `json:"total_ice_succeeded"`
TotalICESucceededTCP int `json:"total_ice_succeeded_tcp"`
TotalICEFailed int `json:"total_ice_failed"`
} }
var tpl = template.Must(template.New("stats").Parse(`# HELP jitsi_threads The number of Java threads that the video bridge is using. var tpl = template.Must(template.New("stats").Parse(`# HELP jitsi_threads The number of Java threads that the video bridge is using.
@ -102,21 +84,12 @@ jitsi_videochannels {{.VideoChannels}}
# HELP jitsi_conferences The current number of conferences. # HELP jitsi_conferences The current number of conferences.
# TYPE jitsi_conferences gauge # TYPE jitsi_conferences gauge
jitsi_conferences {{.Conferences}} jitsi_conferences {{.Conferences}}
# HELP jitsi_p2p_conferences The current number of p2p conferences.
# TYPE jitsi_p2p_conferences gauge
jitsi_p2p_conferences {{.P2PConferences}}
# HELP jitsi_participants The current number of participants. # HELP jitsi_participants The current number of participants.
# TYPE jitsi_participants gauge # TYPE jitsi_participants gauge
jitsi_participants {{.Participants}} jitsi_participants {{.Participants}}
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants {{.TotalParticipants}}
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge. # HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge # TYPE jitsi_videostreams gauge
jitsi_videostreams {{.Videostreams}} jitsi_videostreams {{.Videostreams}}
# HELP jitsi_stress_level Stress Level reported to Jicofo by the videobridge.
# TYPE jitsi_stress_level gauge
jitsi_stress_level {{.StressLevel}}
# HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled. # HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled.
# TYPE jitsi_total_loss_controlled_participant_seconds counter # TYPE jitsi_total_loss_controlled_participant_seconds counter
jitsi_total_loss_controlled_participant_seconds {{.TotalLossControlledParticipantSeconds}} jitsi_total_loss_controlled_participant_seconds {{.TotalLossControlledParticipantSeconds}}
@ -153,60 +126,6 @@ jitsi_total_colibri_web_socket_messages_received {{.TotalColibriWebSocketMessage
# HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets. # HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets.
# TYPE jitsi_total_colibri_web_socket_messages_sent counter # TYPE jitsi_total_colibri_web_socket_messages_sent counter
jitsi_total_colibri_web_socket_messages_sent {{.TotalColibriWebSocketMessagesSent}} jitsi_total_colibri_web_socket_messages_sent {{.TotalColibriWebSocketMessagesSent}}
# HELP jitsi_octo_version The current running OCTO version
# TYPE jitsi_octo_version gauge
jitsi_octo_version {{.OctoVersion}}
# HELP jitsi_octo_conferences The current number of OCTO conferences.
# TYPE jitsi_octo_conferences gauge
jitsi_octo_conferences {{.OctoConferences}}
# HELP jitsi_octo_endpoints The current number of OCTO endpoints.
# TYPE jitsi_octo_endpoints gauge
jitsi_octo_endpoints {{.OctoEndpoints}}
# HELP jitsi_octo_receive_bitrate The total receiving bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_receive_bitrate gauge
jitsi_octo_receive_bitrate {{.OctoReceiveBitrate}}
# HELP jitsi_octo_send_bitrate The total outgoing bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_send_bitrate gauge
jitsi_octo_send_bitrate {{.OctoSendBitrate}}
# HELP jitsi_octo_receive_packet_rate The total incoming packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_receive_packet_rate gauge
jitsi_octo_receive_packet_rate {{.OctoReceivePacketRate}}
# HELP jitsi_octo_send_packet_rate The total outgoing packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_send_packet_rate gauge
jitsi_octo_send_packet_rate {{.OctoSendPacketRate}}
# HELP jitsi_total_bytes_received_octo The total incoming bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_received_octo gauge
jitsi_total_bytes_received_octo {{.TotalBytesReceivedOcto}}
# HELP jitsi_total_bytes_sent_octo The total outgoing bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_sent_octo gauge
jitsi_total_bytes_sent_octo {{.TotalBytesSentOcto}}
# HELP jitsi_total_packets_dropped_octo The total of dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_dropped_octo gauge
jitsi_total_packets_dropped_octo {{.TotalPacketsDroppedOcto}}
# HELP jitsi_total_packets_received_octo The total of incoming dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_received_octo gauge
jitsi_total_packets_received_octo {{.TotalPacketsReceivedOcto}}
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_sent_octo gauge
jitsi_total_packets_sent_octo {{.TotalPacketsSentOcto}}
# HELP total_ice_succeeded_relayed The total number of times an ICE Agent succeeded and the selected candidate pair included a relayed candidate.
# TYPE total_ice_succeeded_relayed gauge
total_ice_succeeded_relayed {{.TotalICESucceededRelayed}}
# HELP total_ice_succeeded The total number of times an ICE Agent succeeded.
# TYPE total_ice_succeeded gauge
total_ice_succeeded {{.TotalICESucceeded}}
# HELP total_ice_succeeded_tcp The total number of times an ICE Agent succeeded and the selected candidate was a TCP candidate.
# TYPE total_ice_succeeded_tcp gauge
total_ice_succeeded_tcp {{.TotalICESucceededTCP}}
# HELP total_ice_failed The total number of times an ICE Agent failed to establish connectivity.
# TYPE total_ice_failed gauge
total_ice_failed {{.TotalICEFailed}}
# HELP jitsi_conference_sizes Distribution of conference sizes
# TYPE jitsi_conference_sizes gauge
{{ range $key, $value := .ConferenceSizes -}}
jitsi_conference_sizes{conference_size="{{$key}}"} {{ $value }}
{{ end -}}
`)) `))
type handler struct { type handler struct {
@ -238,9 +157,6 @@ func main() {
flag.Parse() flag.Parse()
http.Handle("/metrics", handler{sourceURL: *videoBridgeURL}) http.Handle("/metrics", handler{sourceURL: *videoBridgeURL})
http.HandleFunc("/health", func(w http.ResponseWriter, req *http.Request) {
_, _ = w.Write([]byte(`ok`))
})
if err := http.ListenAndServe(*addr, nil); err != nil { if err := http.ListenAndServe(*addr, nil); err != nil {
log.Fatal(err) log.Fatal(err)
} }

View file

@ -22,7 +22,7 @@ func TestGetMetrics(t *testing.T) {
expected string expected string
}{ }{
{ {
statsJson: `{"largest_conference":3,"total_sip_call_failures":0,"total_participants":18,"conference_sizes":[0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"total_not_loaded_in_region_in_conference":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":3},"total_conferences_created":14,"total_conferences_completed":0,"total_recording_failures":0,"conferences":2,"p2p_conferences":1,"total_live_streaming_failures":0,"participants":4}`, statsJson: `{"largest_conference":3,"total_sip_call_failures":0,"total_participants":18,"conference_sizes":[0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"total_not_loaded_in_region_in_conference":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":3},"total_conferences_created":14,"total_conferences_completed":0,"total_recording_failures":0,"conferences":2,"total_live_streaming_failures":0,"participants":4}`,
expected: `# HELP jitsi_threads The number of Java threads that the video bridge is using. expected: `# HELP jitsi_threads The number of Java threads that the video bridge is using.
# TYPE jitsi_threads gauge # TYPE jitsi_threads gauge
jitsi_threads 0 jitsi_threads 0
@ -62,21 +62,12 @@ jitsi_videochannels 0
# HELP jitsi_conferences The current number of conferences. # HELP jitsi_conferences The current number of conferences.
# TYPE jitsi_conferences gauge # TYPE jitsi_conferences gauge
jitsi_conferences 2 jitsi_conferences 2
# HELP jitsi_p2p_conferences The current number of p2p conferences.
# TYPE jitsi_p2p_conferences gauge
jitsi_p2p_conferences 1
# HELP jitsi_participants The current number of participants. # HELP jitsi_participants The current number of participants.
# TYPE jitsi_participants gauge # TYPE jitsi_participants gauge
jitsi_participants 4 jitsi_participants 4
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants 18
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge. # HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge # TYPE jitsi_videostreams gauge
jitsi_videostreams 0 jitsi_videostreams 0
# HELP jitsi_stress_level Stress Level reported to Jicofo by the videobridge.
# TYPE jitsi_stress_level gauge
jitsi_stress_level 0
# HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled. # HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled.
# TYPE jitsi_total_loss_controlled_participant_seconds counter # TYPE jitsi_total_loss_controlled_participant_seconds counter
jitsi_total_loss_controlled_participant_seconds 0 jitsi_total_loss_controlled_participant_seconds 0
@ -113,78 +104,6 @@ jitsi_total_colibri_web_socket_messages_received 0
# HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets. # HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets.
# TYPE jitsi_total_colibri_web_socket_messages_sent counter # TYPE jitsi_total_colibri_web_socket_messages_sent counter
jitsi_total_colibri_web_socket_messages_sent 0 jitsi_total_colibri_web_socket_messages_sent 0
# HELP jitsi_octo_version The current running OCTO version
# TYPE jitsi_octo_version gauge
jitsi_octo_version 0
# HELP jitsi_octo_conferences The current number of OCTO conferences.
# TYPE jitsi_octo_conferences gauge
jitsi_octo_conferences 0
# HELP jitsi_octo_endpoints The current number of OCTO endpoints.
# TYPE jitsi_octo_endpoints gauge
jitsi_octo_endpoints 0
# HELP jitsi_octo_receive_bitrate The total receiving bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_receive_bitrate gauge
jitsi_octo_receive_bitrate 0
# HELP jitsi_octo_send_bitrate The total outgoing bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_send_bitrate gauge
jitsi_octo_send_bitrate 0
# HELP jitsi_octo_receive_packet_rate The total incoming packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_receive_packet_rate gauge
jitsi_octo_receive_packet_rate 0
# HELP jitsi_octo_send_packet_rate The total outgoing packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_send_packet_rate gauge
jitsi_octo_send_packet_rate 0
# HELP jitsi_total_bytes_received_octo The total incoming bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_received_octo gauge
jitsi_total_bytes_received_octo 0
# HELP jitsi_total_bytes_sent_octo The total outgoing bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_sent_octo gauge
jitsi_total_bytes_sent_octo 0
# HELP jitsi_total_packets_dropped_octo The total of dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_dropped_octo gauge
jitsi_total_packets_dropped_octo 0
# HELP jitsi_total_packets_received_octo The total of incoming dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_received_octo gauge
jitsi_total_packets_received_octo 0
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_sent_octo gauge
jitsi_total_packets_sent_octo 0
# HELP total_ice_succeeded_relayed The total number of times an ICE Agent succeeded and the selected candidate pair included a relayed candidate.
# TYPE total_ice_succeeded_relayed gauge
total_ice_succeeded_relayed 0
# HELP total_ice_succeeded The total number of times an ICE Agent succeeded.
# TYPE total_ice_succeeded gauge
total_ice_succeeded 0
# HELP total_ice_succeeded_tcp The total number of times an ICE Agent succeeded and the selected candidate was a TCP candidate.
# TYPE total_ice_succeeded_tcp gauge
total_ice_succeeded_tcp 0
# HELP total_ice_failed The total number of times an ICE Agent failed to establish connectivity.
# TYPE total_ice_failed gauge
total_ice_failed 0
# HELP jitsi_conference_sizes Distribution of conference sizes
# TYPE jitsi_conference_sizes gauge
jitsi_conference_sizes{conference_size="0"} 0
jitsi_conference_sizes{conference_size="1"} 1
jitsi_conference_sizes{conference_size="2"} 0
jitsi_conference_sizes{conference_size="3"} 1
jitsi_conference_sizes{conference_size="4"} 0
jitsi_conference_sizes{conference_size="5"} 0
jitsi_conference_sizes{conference_size="6"} 0
jitsi_conference_sizes{conference_size="7"} 0
jitsi_conference_sizes{conference_size="8"} 0
jitsi_conference_sizes{conference_size="9"} 0
jitsi_conference_sizes{conference_size="10"} 0
jitsi_conference_sizes{conference_size="11"} 0
jitsi_conference_sizes{conference_size="12"} 0
jitsi_conference_sizes{conference_size="13"} 0
jitsi_conference_sizes{conference_size="14"} 0
jitsi_conference_sizes{conference_size="15"} 0
jitsi_conference_sizes{conference_size="16"} 0
jitsi_conference_sizes{conference_size="17"} 0
jitsi_conference_sizes{conference_size="18"} 0
jitsi_conference_sizes{conference_size="19"} 0
jitsi_conference_sizes{conference_size="20"} 0
jitsi_conference_sizes{conference_size="21"} 0
`, `,
}, },
{ {
@ -200,13 +119,6 @@ jitsi_conference_sizes{conference_size="21"} 0
"largest_conference": 0, "largest_conference": 0,
"loss_rate_download": 0.5, "loss_rate_download": 0.5,
"loss_rate_upload": 0.5, "loss_rate_upload": 0.5,
"octo_conferences": 0,
"octo_endpoints": 0,
"octo_receive_bitrate": 0.0,
"octo_receive_packet_rate": 0,
"octo_send_bitrate": 0.0,
"octo_send_packet_rate": 0,
"octo_version": 1,
"packet_rate_download": 0, "packet_rate_download": 0,
"packet_rate_upload": 0, "packet_rate_upload": 0,
"participants": 0, "participants": 0,
@ -214,14 +126,11 @@ jitsi_conference_sizes{conference_size="21"} 0
"relay_id": "10.0.0.5:4096", "relay_id": "10.0.0.5:4096",
"rtp_loss": 0, "rtp_loss": 0,
"rtt_aggregate": 0, "rtt_aggregate": 0,
"stress_level": 0.6,
"threads": 59, "threads": 59,
"total_bytes_received": 257628359, "total_bytes_received": 257628359,
"total_bytes_received_octo": 0, "total_bytes_received_octo": 0,
"total_bytes_received_octo": 0,
"total_bytes_sent": 257754048, "total_bytes_sent": 257754048,
"total_bytes_sent_octo": 0, "total_bytes_sent_octo": 0,
"total_bytes_sent_octo": 0,
"total_colibri_web_socket_messages_received": 0, "total_colibri_web_socket_messages_received": 0,
"total_colibri_web_socket_messages_sent": 0, "total_colibri_web_socket_messages_sent": 0,
"total_conference_seconds": 470, "total_conference_seconds": 470,
@ -232,21 +141,17 @@ jitsi_conference_sizes{conference_size="21"} 0
"total_failed_conferences": 0, "total_failed_conferences": 0,
"total_ice_failed": 0, "total_ice_failed": 0,
"total_ice_succeeded": 2, "total_ice_succeeded": 2,
"total_ice_succeeded_tcp": 1, "total_ice_succeeded_tcp": 0,
"total_loss_controlled_participant_seconds": 847, "total_loss_controlled_participant_seconds": 847,
"total_loss_degraded_participant_seconds": 1, "total_loss_degraded_participant_seconds": 1,
"total_loss_limited_participant_seconds": 0, "total_loss_limited_participant_seconds": 0,
"total_packets_dropped_octo": 0, "total_packets_dropped_octo": 0,
"total_packets_dropped_octo": 0,
"total_packets_received": 266644, "total_packets_received": 266644,
"total_packets_received_octo": 0, "total_packets_received_octo": 0,
"total_packets_received_octo": 0,
"total_packets_sent": 266556, "total_packets_sent": 266556,
"total_packets_sent_octo": 0, "total_packets_sent_octo": 0,
"total_packets_sent_octo": 0,
"total_partially_failed_conferences": 0, "total_partially_failed_conferences": 0,
"total_participants": 2, "total_participants": 2,
"total_ice_succeeded_relayed": 3,
"videochannels": 0, "videochannels": 0,
"videostreams": 0 "videostreams": 0
}`, }`,
@ -289,21 +194,12 @@ jitsi_videochannels 0
# HELP jitsi_conferences The current number of conferences. # HELP jitsi_conferences The current number of conferences.
# TYPE jitsi_conferences gauge # TYPE jitsi_conferences gauge
jitsi_conferences 0 jitsi_conferences 0
# HELP jitsi_p2p_conferences The current number of p2p conferences.
# TYPE jitsi_p2p_conferences gauge
jitsi_p2p_conferences 0
# HELP jitsi_participants The current number of participants. # HELP jitsi_participants The current number of participants.
# TYPE jitsi_participants gauge # TYPE jitsi_participants gauge
jitsi_participants 0 jitsi_participants 0
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants 2
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge. # HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge # TYPE jitsi_videostreams gauge
jitsi_videostreams 0 jitsi_videostreams 0
# HELP jitsi_stress_level Stress Level reported to Jicofo by the videobridge.
# TYPE jitsi_stress_level gauge
jitsi_stress_level 0.6
# HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled. # HELP jitsi_total_loss_controlled_participant_seconds The total number of participant-seconds that are loss-controlled.
# TYPE jitsi_total_loss_controlled_participant_seconds counter # TYPE jitsi_total_loss_controlled_participant_seconds counter
jitsi_total_loss_controlled_participant_seconds 847 jitsi_total_loss_controlled_participant_seconds 847
@ -340,78 +236,6 @@ jitsi_total_colibri_web_socket_messages_received 0
# HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets. # HELP jitsi_total_colibri_web_socket_messages_sent The total number messages sent through COLIBRI web sockets.
# TYPE jitsi_total_colibri_web_socket_messages_sent counter # TYPE jitsi_total_colibri_web_socket_messages_sent counter
jitsi_total_colibri_web_socket_messages_sent 0 jitsi_total_colibri_web_socket_messages_sent 0
# HELP jitsi_octo_version The current running OCTO version
# TYPE jitsi_octo_version gauge
jitsi_octo_version 1
# HELP jitsi_octo_conferences The current number of OCTO conferences.
# TYPE jitsi_octo_conferences gauge
jitsi_octo_conferences 0
# HELP jitsi_octo_endpoints The current number of OCTO endpoints.
# TYPE jitsi_octo_endpoints gauge
jitsi_octo_endpoints 0
# HELP jitsi_octo_receive_bitrate The total receiving bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_receive_bitrate gauge
jitsi_octo_receive_bitrate 0
# HELP jitsi_octo_send_bitrate The total outgoing bitrate for the OCTO video bridge in kilobits per second.
# TYPE jitsi_octo_send_bitrate gauge
jitsi_octo_send_bitrate 0
# HELP jitsi_octo_receive_packet_rate The total incoming packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_receive_packet_rate gauge
jitsi_octo_receive_packet_rate 0
# HELP jitsi_octo_send_packet_rate The total outgoing packet rate for the OCTO video bridge in packets per second.
# TYPE jitsi_octo_send_packet_rate gauge
jitsi_octo_send_packet_rate 0
# HELP jitsi_total_bytes_received_octo The total incoming bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_received_octo gauge
jitsi_total_bytes_received_octo 0
# HELP jitsi_total_bytes_sent_octo The total outgoing bit rate for the OCTO video bridge in bytes per second.
# TYPE jitsi_total_bytes_sent_octo gauge
jitsi_total_bytes_sent_octo 0
# HELP jitsi_total_packets_dropped_octo The total of dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_dropped_octo gauge
jitsi_total_packets_dropped_octo 0
# HELP jitsi_total_packets_received_octo The total of incoming dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_received_octo gauge
jitsi_total_packets_received_octo 0
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
# TYPE jitsi_total_packets_sent_octo gauge
jitsi_total_packets_sent_octo 0
# HELP total_ice_succeeded_relayed The total number of times an ICE Agent succeeded and the selected candidate pair included a relayed candidate.
# TYPE total_ice_succeeded_relayed gauge
total_ice_succeeded_relayed 3
# HELP total_ice_succeeded The total number of times an ICE Agent succeeded.
# TYPE total_ice_succeeded gauge
total_ice_succeeded 2
# HELP total_ice_succeeded_tcp The total number of times an ICE Agent succeeded and the selected candidate was a TCP candidate.
# TYPE total_ice_succeeded_tcp gauge
total_ice_succeeded_tcp 1
# HELP total_ice_failed The total number of times an ICE Agent failed to establish connectivity.
# TYPE total_ice_failed gauge
total_ice_failed 0
# HELP jitsi_conference_sizes Distribution of conference sizes
# TYPE jitsi_conference_sizes gauge
jitsi_conference_sizes{conference_size="0"} 0
jitsi_conference_sizes{conference_size="1"} 0
jitsi_conference_sizes{conference_size="2"} 0
jitsi_conference_sizes{conference_size="3"} 0
jitsi_conference_sizes{conference_size="4"} 0
jitsi_conference_sizes{conference_size="5"} 0
jitsi_conference_sizes{conference_size="6"} 0
jitsi_conference_sizes{conference_size="7"} 0
jitsi_conference_sizes{conference_size="8"} 0
jitsi_conference_sizes{conference_size="9"} 0
jitsi_conference_sizes{conference_size="10"} 0
jitsi_conference_sizes{conference_size="11"} 0
jitsi_conference_sizes{conference_size="12"} 0
jitsi_conference_sizes{conference_size="13"} 0
jitsi_conference_sizes{conference_size="14"} 0
jitsi_conference_sizes{conference_size="15"} 0
jitsi_conference_sizes{conference_size="16"} 0
jitsi_conference_sizes{conference_size="17"} 0
jitsi_conference_sizes{conference_size="18"} 0
jitsi_conference_sizes{conference_size="19"} 0
jitsi_conference_sizes{conference_size="20"} 0
jitsi_conference_sizes{conference_size="21"} 0
`, `,
}, },
} }