Skip to content

Commit f6b7c0a

Browse files
author
Ildar Iskhakov
authored
Merge pull request #41 from grafana/dev
Merge dev to main
2 parents 2490a97 + b3add5c commit f6b7c0a

File tree

77 files changed

+549
-2464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+549
-2464
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ frontend/node_modules
55
frontend/build
66
package-lock.json
77
./engine/extensions
8-
.env
8+
.env
9+
.env-hobby

.drone.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ services:
157157

158158
trigger:
159159
event:
160-
- push
160+
include:
161161
- tag
162+
- push
163+
ref:
164+
include:
165+
- refs/heads/**
166+
- refs/tags/v*.*.*
162167

163168
---
164169
# Secret for pulling docker images.
@@ -231,6 +236,6 @@ kind: secret
231236
name: drone_token
232237
---
233238
kind: signature
234-
hmac: 81b9b7cda5a8f8525f40f39821be50881e0c4cb0c40a45b3e63bc0cc47274649
239+
hmac: 5cdafa5ca416acb1763d1d9ac93bbd932982c874718f40af533914a6711c1a1f
235240

236241
...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.pyc
44
venv
55
.env
6+
.env_hobby
67
.vscode
78
dump.rdb
89
.idea

DEVELOPER.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
1. Start stateful services (RabbitMQ, Redis, Grafana with mounted plugin folder)
3030
```bash
31-
docker-compose -f developer-docker-compose.yml up -d
31+
docker-compose -f docker-compose-developer.yml up -d
3232
```
3333

3434
2. Prepare a python environment:
@@ -53,9 +53,6 @@ export $(grep -v '^#' .env | xargs -0)
5353
# Hint: there is a known issue with uwsgi. It's not used in the local dev environment. Feel free to comment it in `engine/requirements.txt`.
5454
cd engine && pip install -r requirements.txt
5555

56-
# Create folder for database
57-
mkdir sqlite_data
58-
5956
# Migrate the DB:
6057
python manage.py migrate
6158

@@ -107,7 +104,7 @@ python manage.py issue_invite_for_the_frontend --override
107104
OnCall API URL:
108105
http://host.docker.internal:8000
109106
110-
OnCall Invitation Token (Single use token to connect Grafana instance):
107+
Invitation Token (Single use token to connect Grafana instance):
111108
Response from the invite generator command (check above)
112109
113110
Grafana URL (URL OnCall will use to talk to Grafana instance):
@@ -119,7 +116,7 @@ host IP from inside the container by running:
119116
```bash
120117
/sbin/ip route|awk '/default/ { print $3 }'
121118

122-
# Alternatively add host.docker.internal as an extra_host for grafana in developer-docker-compose.yml
119+
# Alternatively add host.docker.internal as an extra_host for grafana in docker-compose-developer.yml
123120
extra_hosts:
124121
- "host.docker.internal:host-gateway"
125122

@@ -260,7 +257,7 @@ lt --port 8000 -s pretty-turkey-83 --print-requests
260257
or set BASE_URL Env variable through web interface.
261258
262259
8. Edit grafana-plugin/src/plugin.json to add `Bypass-Tunnel-Reminder` header section for all existing routes
263-
> this headers required for the local development only, otherwise localtunnel blocks requests from grafana plugin
260+
> this headers required for the local development only, otherwise localtunnel blocks requests from grafana plugin, An alternative to this is you can modify your user-agent in your browser to bypass the tunnel warning, it only filters the common browsers.
264261

265262
```
266263
{

README.md

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,61 @@
1-
# Grafana OnCall Incident Response
2-
Grafana OnCall, cloud version of Grafana OnCall: https://grafana.com/products/cloud/
1+
<img width="400px" src="docs/img/logo.png">
32

4-
Developer-friendly, incident response management with brilliant Slack integration.
5-
- Connect monitoring systems
6-
- Collect and analyze data
7-
- On-call rotation
8-
- Automatic escalation
9-
- Never miss alerts with calls and SMS
3+
Developer-friendly, incident response with brilliant Slack integration.
104

11-
![Grafana OnCall Screenshot](screenshot.png)
5+
<img width="60%" src="screenshot.png">
6+
7+
- Collect and analyze alerts from multiple monitoring systems
8+
- On-call rotations based on schedules
9+
- Automatic escalations
10+
- Phone calls, SMS, Slack, Telegram notifications
1211

1312
## Getting Started
14-
OnCall consists of two parts:
15-
1. OnCall backend
16-
2. "Grafana OnCall" plugin you need to install in your Grafana
1713

18-
### How to run OnCall backend
19-
1. An all-in-one image of OnCall is available on docker hub to run it:
14+
We prepared multiple environments: [production](PRODUCTION.md), [developer](DEVELOPER.md) and hobby:
15+
16+
1. Download docker-compose.yaml:
2017
```bash
21-
docker run -it --name oncall-backend -p 8000:8000 grafana/oncall-all-in-one
18+
curl https://github.com/grafana/oncall/blob/dev/docker-compose.yml -o docker-compose.yaml
2219
```
2320

24-
2. When the image starts up you will see a message like this:
21+
2. Set variables:
2522
```bash
26-
👋 This script will issue an invite token to securely connect the frontend.
27-
Maintainers will be happy to help in the slack channel #grafana-oncall: https://slack.grafana.com/
28-
Your invite token: <TOKEN>, use it in the Grafana OnCall plugin.
23+
echo "DOMAIN=http://localhost
24+
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long
25+
RABBITMQ_PASSWORD=rabbitmq_secret_pw
26+
MYSQL_PASSWORD=mysql_secret_pw
27+
COMPOSE_PROFILES=with_grafana # Remove this line if you want to use existing grafana
28+
GRAFANA_USER=admin
29+
GRAFANA_PASSWORD=admin" > .env_hobby
2930
```
3031

31-
3. If you started your container detached with -d check the log:
32+
3. Launch services:
3233
```bash
33-
docker logs oncall-backend
34+
docker-compose --env-file .env_hobby -f docker-compose.yml up --build -d
3435
```
3536

36-
### How to install "Grafana OnCall" Plugin and connect with a backend
37-
1. Open Grafana in your browser and login as an Admin
38-
2. Navigate to Configuration &rarr; Plugins
39-
3. Type Grafana OnCall into the "Search Grafana plugins" field
40-
4. Select the Grafana OnCall plugin and press the "Install" button
41-
5. On the Grafana OnCall Plugin page Enable the plugin and go to the Configuration tab you should see a status field with the message
37+
4. Issue one-time invite token:
38+
```bash
39+
docker-compose --env-file .env_hobby -f docker-compose.yml run engine python manage.py issue_invite_for_the_frontend --override
4240
```
43-
OnCall has not been setup, configure & initialize below.
41+
42+
5. Go to [OnCall Plugin Configuration](http://localhost:3000/plugins/grafana-oncall-app) (or find OnCall plugin in configuration->plugins) and connect OnCall _plugin_ with OnCall _backend_:
4443
```
45-
6. Fill in configuration fields using the token you got from the backend earlier, then press "Install Configuration"
44+
Invite token: ^^^ from the previous step.
45+
OnCall backend URL: http://engine:8080
46+
Grafana Url: http://grafana:3000
4647
```
47-
OnCall API URL: (The URL & port used to access OnCall)
48-
http://host.docker.internal:8000
49-
50-
OnCall Invitation Token (Single use token to connect Grafana instance):
51-
Invitation token from docker startup
5248

53-
Grafana URL (URL OnCall will use to talk to this Grafana instance):
54-
http://localhost:3000 (or http://host.docker.internal:3000 if your grafana is running in Docker locally)
55-
```
49+
6. Enjoy!
5650

57-
## Getting Help
58-
- `#grafana-oncall` channel at https://slack.grafana.com/
59-
- Grafana Labs community forum for OnCall: https://community.grafana.com
60-
- File an [issue](https://github.com/grafana/oncall/issues) for bugs, issues and feature suggestions.
6151

62-
## Production Setup
52+
## Join community
6353

64-
Looking for the production instructions? We're going to release them soon. Please join our Slack channel to be the first to know about them.
54+
<a href="https://github.com/grafana/oncall/discussions/categories/community-calls"><img width="200px" src="docs/img/community_call.png"></a>
55+
<a href="https://github.com/grafana/oncall/discussions"><img width="200px" src="docs/img/GH_discussions.png"></a>
56+
<a href="https://slack.grafana.com/"><img width="200px" src="docs/img/slack.png"></a>
6557

6658
## Further Reading
6759
- *Documentation* - [Grafana OnCall](https://grafana.com/docs/grafana-cloud/oncall/)
6860
- *Blog Post* - [Announcing Grafana OnCall, the easiest way to do on-call management](https://grafana.com/blog/2021/11/09/announcing-grafana-oncall/)
6961
- *Presentation* - [Deep dive into the Grafana, Prometheus, and Alertmanager stack for alerting and on-call management](https://grafana.com/go/observabilitycon/2021/alerting/?pg=blog)
70-
71-
## FAQ
72-
73-
- How do I generate a new invitation token to connect plugin with a backend?
74-
```bash
75-
docker exec oncall-backend python manage.py issue_invite_for_the_frontend --override
76-
```

developer-docker-compose.yml renamed to docker-compose-developer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
ports:
1313
- 3306:3306
1414
environment:
15-
MYSQL_ROOT_PASSWORD: local_dev_pwd
15+
MYSQL_ROOT_PASSWORD: empty
1616
MYSQL_DATABASE: oncall_local_dev
1717
healthcheck:
1818
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
@@ -42,21 +42,21 @@ services:
4242
mysql-to-create-grafana-db:
4343
image: mariadb:10.2
4444
platform: linux/x86_64
45-
command: bash -c "mysql -h mysql -uroot -plocal_dev_pwd -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
45+
command: bash -c "mysql -h mysql -uroot -pempty -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
4646
depends_on:
4747
mysql:
4848
condition: service_healthy
4949

5050
grafana:
51-
image: "grafana/grafana:8.5.5"
51+
image: "grafana/grafana:9.0.0-beta3"
5252
restart: always
5353
mem_limit: 500m
5454
cpus: 0.5
5555
environment:
5656
GF_DATABASE_TYPE: mysql
5757
GF_DATABASE_HOST: mysql
5858
GF_DATABASE_USER: root
59-
GF_DATABASE_PASSWORD: local_dev_pwd
59+
GF_DATABASE_PASSWORD: empty
6060
GF_SECURITY_ADMIN_USER: oncall
6161
GF_SECURITY_ADMIN_PASSWORD: oncall
6262
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: grafana-oncall-app

0 commit comments

Comments
 (0)