Skip to content

Commit 9c87bba

Browse files
authored
feat(jitsi-meet): added grafana loki and otel integration for log analysis (#1844)
1 parent fcb90ba commit 9c87bba

File tree

10 files changed

+719
-0
lines changed

10 files changed

+719
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*.swp
22
.env*
33
docker-compose.override.yml
4+
log-analyser/grafana
5+
**/.DS_Store
6+
**/.idea

grafana.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.5'
2+
3+
services:
4+
# Grafana: used for visualization of metrics and log data through customizable dashboards.
5+
grafana:
6+
image: grafana/grafana:10.2.0
7+
environment:
8+
- GF_ANALYTICS_REPORTING_ENABLED=false
9+
volumes:
10+
- ./log-analyser/grafana:/var/lib/grafana
11+
- ./log-analyser/grafana-provisioning/:/etc/grafana/provisioning/
12+
ports:
13+
- "3000:3000"

log-analyser.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3.5'
2+
3+
services:
4+
# Log Analyser: used for setting up a log analysis system for visualization, log collection and log processing.
5+
6+
loki:
7+
container_name: loki
8+
image: grafana/loki:3.0.0
9+
command: -config.file=/conf/loki-config.yaml
10+
volumes:
11+
- ./log-analyser/loki/data:/data
12+
- ./log-analyser/loki/conf:/conf
13+
ports:
14+
- "3100:3100"
15+
16+
otel-collector:
17+
container_name: otel
18+
image: otel/opentelemetry-collector-contrib
19+
volumes:
20+
- ./log-analyser/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
21+
- ./log-analyser/jitsi-logs/:/tmp/jitsi-logs/

log-analyser/README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# JITSI MEET LOG ANALYSER - Grafana Loki and OpenTelemetry Integration
2+
3+
Welcome to the Grafana Loki and OpenTelemetry integration project! This repository provides a simple and effective setup for log management and analysis using Docker, Grafana Loki, and OpenTelemetry.
4+
Currently this is an in-progress GSoC Summer of Code project and so the instructions may change before being finalized. Please treat all this as alpha code.
5+
6+
## Overview
7+
8+
This project demonstrates how to configure and use Grafana Loki with OpenTelemetry to collect, parse, and visualize log data. It includes:
9+
10+
- A Docker Compose setup (`log-analyser.yml`) for Loki and OpenTelemetry Collector.
11+
- A Docker Compose setup (`grafana.yml`) for Grafana.
12+
- Configuration files for log parsing and exporting.
13+
- Instructions to set up and access Grafana with Loki as a data source.
14+
-
15+
## Getting Started
16+
17+
### Prerequisites
18+
19+
- Docker
20+
- Docker Compose
21+
22+
### Setup
23+
24+
1. **Clone the repository:**
25+
26+
```bash
27+
git clone https://github.com/jitsi/docker-jitsi-meet.git
28+
```
29+
30+
### Log Analyser
31+
32+
1. **Add your log files:**
33+
34+
Place your log file in the `log-analyser/jitsi-logs` directory. Update the `otel-collector-config.yaml` file with the correct file path to start ingesting the logs. This setup allows OpenTelemetry to read logs from the file and forward them to Loki.
35+
36+
2. **Update the otel-collector-config.yaml file:**
37+
38+
Update the file path to point to your log file for ingestion by OpenTelemetry.
39+
40+
3. **Start the Docker containers:**
41+
42+
```bash
43+
docker-compose -f docker-compose.yml -f log-analyser.yml up -d
44+
```
45+
46+
### Grafana
47+
48+
1. **Start the Docker container:**
49+
50+
```bash
51+
docker-compose -f docker-compose.yml -f grafana.yml up -d
52+
```
53+
54+
2. **Access Grafana:**
55+
56+
Open your web browser and navigate to [http://localhost:3000](http://localhost:3000).
57+
58+
3. **Log in to Grafana:**
59+
60+
Use the default credentials:
61+
62+
```
63+
Username: admin
64+
Password: admin
65+
```
66+
67+
### Dashboard Setup
68+
69+
The dashboard setups are available as JSON files in the `log-analyser/grafana-dashboards` directory. You can import these JSON files into Grafana to use the pre-configured dashboards. In the future, we plan to automate this import process.
70+
71+
72+
## Usage
73+
74+
- **Log Parsing and Visualization:** After setting up, you can use Grafana to explore and visualize your logs. Check our dashboards and panels to monitor log data effectively.
75+
76+
77+
## Acknowledgements
78+
79+
Thanks for checking out this project! If you have any questions or need further assistance, don't hesitate to reach out.
+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"annotations": {
3+
"list": [
4+
{
5+
"builtIn": 1,
6+
"datasource": {
7+
"type": "grafana",
8+
"uid": "-- Grafana --"
9+
},
10+
"enable": true,
11+
"hide": true,
12+
"iconColor": "rgba(0, 211, 255, 1)",
13+
"name": "Annotations & Alerts",
14+
"type": "dashboard"
15+
}
16+
]
17+
},
18+
"editable": true,
19+
"fiscalYearStartMonth": 0,
20+
"graphTooltip": 0,
21+
"id": 1,
22+
"links": [],
23+
"liveNow": false,
24+
"panels": [
25+
{
26+
"datasource": {
27+
"type": "loki",
28+
"uid": "b8130a28-4867-4668-917d-539c93852857"
29+
},
30+
"fieldConfig": {
31+
"defaults": {
32+
"color": {
33+
"mode": "palette-classic"
34+
},
35+
"custom": {
36+
"hideFrom": {
37+
"legend": false,
38+
"tooltip": false,
39+
"viz": false
40+
}
41+
},
42+
"mappings": []
43+
},
44+
"overrides": []
45+
},
46+
"gridPos": {
47+
"h": 8,
48+
"w": 12,
49+
"x": 0,
50+
"y": 0
51+
},
52+
"id": 2,
53+
"options": {
54+
"displayLabels": [
55+
"percent"
56+
],
57+
"legend": {
58+
"calcs": [],
59+
"displayMode": "hidden",
60+
"placement": "right",
61+
"showLegend": false,
62+
"values": []
63+
},
64+
"pieType": "pie",
65+
"reduceOptions": {
66+
"calcs": [
67+
"lastNotNull"
68+
],
69+
"fields": "",
70+
"values": false
71+
},
72+
"tooltip": {
73+
"mode": "single",
74+
"sort": "none"
75+
}
76+
},
77+
"targets": [
78+
{
79+
"datasource": {
80+
"type": "loki",
81+
"uid": "b8130a28-4867-4668-917d-539c93852857"
82+
},
83+
"editorMode": "code",
84+
"expr": "sum by (attributes_level) (\n rate({exporter=\"OTLP\"} | json|attributes_log_file_name=\"jicofo.log\"| line_format \"{{.log}}\" | logfmt | pattern \"[<_>] <_level>: <_>\"[5m])\n)",
85+
"legendFormat": "Level: {{attributes_level}}",
86+
"queryType": "range",
87+
"refId": "A"
88+
}
89+
],
90+
"title": "Log Levels Pie Chart",
91+
"type": "piechart"
92+
},
93+
{
94+
"datasource": {
95+
"type": "loki",
96+
"uid": "b8130a28-4867-4668-917d-539c93852857"
97+
},
98+
"fieldConfig": {
99+
"defaults": {
100+
"color": {
101+
"mode": "continuous-GrYlRd"
102+
},
103+
"mappings": [],
104+
"thresholds": {
105+
"mode": "absolute",
106+
"steps": [
107+
{
108+
"color": "green"
109+
},
110+
{
111+
"color": "red",
112+
"value": 80
113+
}
114+
]
115+
}
116+
},
117+
"overrides": []
118+
},
119+
"gridPos": {
120+
"h": 8,
121+
"w": 12,
122+
"x": 0,
123+
"y": 8
124+
},
125+
"id": 1,
126+
"options": {
127+
"displayMode": "lcd",
128+
"minVizHeight": 10,
129+
"minVizWidth": 0,
130+
"namePlacement": "auto",
131+
"orientation": "horizontal",
132+
"reduceOptions": {
133+
"calcs": [
134+
"lastNotNull"
135+
],
136+
"fields": "",
137+
"values": false
138+
},
139+
"showUnfilled": true,
140+
"valueMode": "color"
141+
},
142+
"pluginVersion": "10.2.0",
143+
"targets": [
144+
{
145+
"datasource": {
146+
"type": "loki",
147+
"uid": "b8130a28-4867-4668-917d-539c93852857"
148+
},
149+
"editorMode": "code",
150+
"expr": "sum by (attributes_level, attributes_log_file_name) (\n rate({exporter=\"OTLP\"} | json|attributes_log_file_name=\"jicofo.log\"| line_format \"{{.attributes_message}}\" | logfmt | pattern \"[<_>] <attributes_level>#<attributes_log_file_name>: <_>\"[5m]))",
151+
"legendFormat": "Level: {{attributes_level}}",
152+
"queryType": "range",
153+
"refId": "A"
154+
}
155+
],
156+
"title": "Log Levels Bar Chart",
157+
"transformations": [],
158+
"type": "bargauge"
159+
}
160+
],
161+
"refresh": "",
162+
"schemaVersion": 38,
163+
"tags": [],
164+
"templating": {
165+
"list": []
166+
},
167+
"time": {
168+
"from": "now-6h",
169+
"to": "now"
170+
},
171+
"timepicker": {},
172+
"timezone": "",
173+
"title": "Jicofo Logs",
174+
"uid": "f2dcfe84-3c27-4b1d-8583-bc2c97a8d22d",
175+
"version": 5,
176+
"weekStart": ""
177+
}

0 commit comments

Comments
 (0)