-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
9,361 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DOMAIN=http://localhost:8082 | ||
# COMPOSE_PROFILES=with_grafana # Remove this line if you want to use existing grafana | ||
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Integrate OnCall | ||
|
||
> This is a working copy from [Doc](https://github.com/grafana/oncall/blob/dev/README.md). | ||
## Getting Started | ||
|
||
We prepared multiple environments: | ||
|
||
- [production](https://grafana.com/docs/grafana-cloud/oncall/open-source/#production-environment) | ||
- [developer](./dev/README.md) | ||
- hobby (described in the following steps) | ||
|
||
1. Download [`docker-compose.yml`](docker-compose.yml): | ||
|
||
```bash | ||
curl -fsSL https://raw.githubusercontent.com/grafana/oncall/dev/docker-compose.yml -o docker-compose.yml | ||
``` | ||
|
||
2. Set variables: | ||
|
||
```bash | ||
echo "DOMAIN=http://localhost:8080 | ||
COMPOSE_PROFILES=with_grafana # Remove this line if you want to use existing grafana | ||
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long" > .env | ||
``` | ||
|
||
an .env with ` | ||
``` | ||
DOMAIN=http://localhost:8080 # verify the port is correct | ||
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long # just for demonstration | ||
``` | ||
|
||
3. Launch services: | ||
|
||
```bash | ||
docker-compose pull && docker-compose up -d | ||
``` | ||
|
||
4. Go to [OnCall Plugin Configuration](http://localhost:3000/plugins/grafana-oncall-app), using log in credentials | ||
as defined above: `admin`/`admin` (or find OnCall plugin in configuration->plugins) and connect OnCall _plugin_ | ||
with OnCall _backend_: | ||
|
||
```text | ||
OnCall backend URL: http://engine:8080 | ||
``` | ||
|
||
5. Enjoy! Check our [OSS docs](https://grafana.com/docs/grafana-cloud/oncall/open-source/) if you want to set up | ||
Slack, Telegram, Twilio or SMS/calls through Grafana Cloud. | ||
|
||
## Update version | ||
|
||
To update your Grafana OnCall hobby environment: | ||
|
||
```shell | ||
# Update Docker image | ||
docker-compose pull engine | ||
# Re-deploy | ||
docker-compose up -d | ||
``` | ||
|
||
After updating the engine, you'll also need to click the "Update" button on the [plugin version page](http://localhost:3000/plugins/grafana-oncall-app?page=version-history). | ||
See [Grafana docs](https://grafana.com/docs/grafana/latest/administration/plugin-management/#update-a-plugin) for more | ||
info on updating Grafana plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
version: "3.9" | ||
|
||
volumes: | ||
grafana_data: | ||
oncall_data: | ||
redis_data: | ||
|
||
networks: | ||
default: | ||
name: monitoring-network | ||
|
||
x-environment: &oncall-environment | ||
DATABASE_TYPE: sqlite3 | ||
BROKER_TYPE: redis | ||
BASE_URL: $DOMAIN | ||
SECRET_KEY: my_random_secret_must_be_more_than_32_characters_long | ||
REDIS_URI: redis://redis:6379/0 | ||
DJANGO_SETTINGS_MODULE: settings.hobby | ||
CELERY_WORKER_QUEUE: "default,critical,long,slack,telegram,webhook,retry,celery" | ||
CELERY_WORKER_CONCURRENCY: "1" | ||
CELERY_WORKER_MAX_TASKS_PER_CHILD: "100" | ||
CELERY_WORKER_SHUTDOWN_INTERVAL: "65m" | ||
CELERY_WORKER_BEAT_ENABLED: "True" | ||
GRAFANA_API_URL: http://grafana:3000 | ||
|
||
services: | ||
engine: | ||
image: grafana/oncall | ||
restart: unless-stopped | ||
ports: | ||
- "8082:8080" | ||
command: > | ||
sh -c "uwsgi --ini uwsgi.ini" | ||
environment: *oncall-environment | ||
volumes: | ||
- oncall_data:/var/lib/oncall | ||
depends_on: | ||
oncall_db_migration: | ||
condition: service_completed_successfully | ||
redis: | ||
condition: service_healthy | ||
|
||
celery: | ||
image: grafana/oncall | ||
restart: unless-stopped | ||
command: sh -c "./celery_with_exporter.sh" | ||
environment: *oncall-environment | ||
volumes: | ||
- oncall_data:/var/lib/oncall | ||
depends_on: | ||
oncall_db_migration: | ||
condition: service_completed_successfully | ||
redis: | ||
condition: service_healthy | ||
|
||
oncall_db_migration: | ||
image: grafana/oncall | ||
command: python manage.py migrate --noinput | ||
environment: *oncall-environment | ||
volumes: | ||
- oncall_data:/var/lib/oncall | ||
depends_on: | ||
redis: | ||
condition: service_healthy | ||
|
||
redis: | ||
image: redis:7.0.5 | ||
restart: unless-stopped | ||
expose: | ||
- 6379 | ||
volumes: | ||
- redis_data:/data | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 500m | ||
cpus: "0.5" | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
timeout: 5s | ||
interval: 5s | ||
retries: 10 |
Oops, something went wrong.