Compare commits
No commits in common. "main" and "1.1.9" have entirely different histories.
12 changed files with 59 additions and 196 deletions
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
@ -1 +0,0 @@
|
||||||
* @0x46616c6b
|
|
25
.github/dependabot.yml
vendored
25
.github/dependabot.yml
vendored
|
@ -4,31 +4,12 @@ updates:
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "daily"
|
||||||
day: "friday"
|
|
||||||
time: "09:00"
|
|
||||||
timezone: "Europe/Berlin"
|
|
||||||
groups:
|
|
||||||
gomod:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: "docker"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "daily"
|
||||||
day: "friday"
|
|
||||||
time: "09:00"
|
|
||||||
timezone: "Europe/Berlin"
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "daily"
|
||||||
day: "friday"
|
|
||||||
time: "09:00"
|
|
||||||
timezone: "Europe/Berlin"
|
|
||||||
groups:
|
|
||||||
github-actions:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
17
.github/release-drafter.yml
vendored
17
.github/release-drafter.yml
vendored
|
@ -1,5 +1,3 @@
|
||||||
name-template: '$RESOLVED_VERSION'
|
|
||||||
tag-template: '$RESOLVED_VERSION'
|
|
||||||
categories:
|
categories:
|
||||||
- title: '🚀 Features'
|
- title: '🚀 Features'
|
||||||
labels:
|
labels:
|
||||||
|
@ -14,21 +12,6 @@ categories:
|
||||||
labels:
|
labels:
|
||||||
- 'chore'
|
- 'chore'
|
||||||
- 'dependencies'
|
- 'dependencies'
|
||||||
version-resolver:
|
|
||||||
major:
|
|
||||||
labels:
|
|
||||||
- 'feature'
|
|
||||||
minor:
|
|
||||||
labels:
|
|
||||||
- 'enhancement'
|
|
||||||
patch:
|
|
||||||
labels:
|
|
||||||
- 'fix'
|
|
||||||
- 'bugfix'
|
|
||||||
- 'bug'
|
|
||||||
- 'chore'
|
|
||||||
- 'dependencies'
|
|
||||||
default: patch
|
|
||||||
template: |
|
template: |
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
|
|
59
.github/workflows/integration.yaml
vendored
59
.github/workflows/integration.yaml
vendored
|
@ -4,29 +4,19 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
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.4.0
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v2.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.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: go vet
|
||||||
|
@ -36,50 +26,19 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v2.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.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: go build ./...
|
||||||
|
|
||||||
- name: Docker
|
- name: Docker
|
||||||
run: docker build .
|
run: docker build .
|
||||||
|
|
||||||
automerge:
|
|
||||||
name: Merge Automatically
|
|
||||||
needs: [test, build]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Obtain Access Token
|
|
||||||
id: acces_token
|
|
||||||
run: |
|
|
||||||
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 }}
|
|
||||||
|
|
6
.github/workflows/quality.yaml
vendored
6
.github/workflows/quality.yaml
vendored
|
@ -4,13 +4,13 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
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.4.0
|
||||||
- name: GolangCI
|
- name: GolangCI
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
|
18
.github/workflows/release-drafter.yaml
vendored
18
.github/workflows/release-drafter.yaml
vendored
|
@ -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 }}
|
|
36
.github/workflows/release.yaml
vendored
36
.github/workflows/release.yaml
vendored
|
@ -1,40 +1,40 @@
|
||||||
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
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2.4.0
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v2.2.0
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.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: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v1.13.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Publish Changelog
|
||||||
|
uses: release-drafter/release-drafter@v5.18.1
|
||||||
|
with:
|
||||||
|
publish: true
|
||||||
|
name: ${{ github.ref_name }}
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build Releases
|
- name: Build Releases
|
||||||
uses: goreleaser/goreleaser-action@v5.0.0
|
uses: goreleaser/goreleaser-action@v2.8.1
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,30 +1,28 @@
|
||||||
# syntax=docker/dockerfile:1
|
FROM alpine:3.15.0 as builder
|
||||||
|
|
||||||
# Build the application from source
|
WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
|
||||||
FROM golang:1.21.4 AS build-stage
|
|
||||||
|
|
||||||
WORKDIR /app
|
ENV USER=appuser
|
||||||
|
ENV UID=10001
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
RUN adduser \
|
||||||
RUN go mod download
|
--disabled-password \
|
||||||
|
--gecos "" \
|
||||||
|
--home "/nonexistent" \
|
||||||
|
--shell "/sbin/nologin" \
|
||||||
|
--no-create-home \
|
||||||
|
--uid "${UID}" \
|
||||||
|
"${USER}"
|
||||||
|
|
||||||
COPY *.go ./
|
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
|
FROM scratch
|
||||||
|
|
||||||
# Run the tests in the container
|
COPY --from=builder /etc/passwd /etc/passwd
|
||||||
FROM build-stage AS run-test-stage
|
COPY --from=builder /etc/group /etc/group
|
||||||
RUN go test -v ./...
|
COPY prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
|
||||||
|
|
||||||
# Deploy the application binary into a lean image
|
USER appuser:appuser
|
||||||
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"]
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -2,4 +2,4 @@ module github.com/systemli/prometheus-jitsi-meet-exporter
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require github.com/google/go-cmp v0.6.0
|
require github.com/google/go-cmp v0.5.7
|
||||||
|
|
6
go.sum
6
go.sum
|
@ -1,2 +1,4 @@
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
|
16
main.go
16
main.go
|
@ -57,10 +57,6 @@ type videoBridgeStats struct {
|
||||||
TotalPacketsDroppedOcto int `json:"total_packets_dropped_octo"`
|
TotalPacketsDroppedOcto int `json:"total_packets_dropped_octo"`
|
||||||
TotalPacketsReceivedOcto int `json:"total_packets_received_octo"`
|
TotalPacketsReceivedOcto int `json:"total_packets_received_octo"`
|
||||||
TotalPacketsSentOcto int `json:"total_packets_sent_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.
|
||||||
|
@ -189,18 +185,6 @@ jitsi_total_packets_received_octo {{.TotalPacketsReceivedOcto}}
|
||||||
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
|
# 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
|
# TYPE jitsi_total_packets_sent_octo gauge
|
||||||
jitsi_total_packets_sent_octo {{.TotalPacketsSentOcto}}
|
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
|
# HELP jitsi_conference_sizes Distribution of conference sizes
|
||||||
# TYPE jitsi_conference_sizes gauge
|
# TYPE jitsi_conference_sizes gauge
|
||||||
{{ range $key, $value := .ConferenceSizes -}}
|
{{ range $key, $value := .ConferenceSizes -}}
|
||||||
|
|
27
main_test.go
27
main_test.go
|
@ -149,18 +149,6 @@ jitsi_total_packets_received_octo 0
|
||||||
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
|
# 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
|
# TYPE jitsi_total_packets_sent_octo gauge
|
||||||
jitsi_total_packets_sent_octo 0
|
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
|
# HELP jitsi_conference_sizes Distribution of conference sizes
|
||||||
# TYPE jitsi_conference_sizes gauge
|
# TYPE jitsi_conference_sizes gauge
|
||||||
jitsi_conference_sizes{conference_size="0"} 0
|
jitsi_conference_sizes{conference_size="0"} 0
|
||||||
|
@ -232,7 +220,7 @@ 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,
|
||||||
|
@ -246,7 +234,6 @@ jitsi_conference_sizes{conference_size="21"} 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
|
||||||
}`,
|
}`,
|
||||||
|
@ -376,18 +363,6 @@ jitsi_total_packets_received_octo 0
|
||||||
# HELP jitsi_total_packets_sent_octo The total of sent dropped packets handled by the OCTO video bridge.
|
# 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
|
# TYPE jitsi_total_packets_sent_octo gauge
|
||||||
jitsi_total_packets_sent_octo 0
|
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
|
# HELP jitsi_conference_sizes Distribution of conference sizes
|
||||||
# TYPE jitsi_conference_sizes gauge
|
# TYPE jitsi_conference_sizes gauge
|
||||||
jitsi_conference_sizes{conference_size="0"} 0
|
jitsi_conference_sizes{conference_size="0"} 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue