Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions examples/compose-with-grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@ This is a demo [Docker Compose](https://docs.docker.com/compose/) setup for [Res

## Quickstart

Build `rest-server` in Docker:
Bring up the Docker Compose stack (Optionally add `--build` to build image from repository instead of downloading):

cd ../..
make docker_build
cd -

Bring up the Docker Compose stack:

docker-compose build
docker-compose up -d
docker compose up -d

Check if everything is up and running:

docker-compose ps

Grafana will be running on [http://localhost:8030/](http://localhost:8030/) with username "admin" and password "admin". The first time you access it you will be asked to setup a data source. Configure it like this (make sure you name it "prometheus", as this is hardcoded in the example dashboard):

![Add data source](datasource.png)
docker compose ps

The Rest Server dashboard can be accessed on [http://localhost:8030/dashboard/file/rest-server.json](http://localhost:8030/dashboard/file/rest-server.json).
Grafana will be running on [http://localhost:8030/](http://localhost:8030/) with username "admin" and password "admin". When you login, you should be greeted by the dashboard, without any data.

Prometheus can be accessed on [http://localhost:8020/](http://localhost:8020/).

Expand Down
Binary file removed examples/compose-with-grafana/datasource.png
Binary file not shown.
9 changes: 4 additions & 5 deletions examples/compose-with-grafana/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Demo of rest-server with prometheus and grafana
version: '2'

services:
restserver:
# NOTE: You must run `make docker_build` in the repo root first
# NOTE: Use `docker compose up --build -d` to build the image locally
# If you want to run this in production, you want auth and tls!
image: restic/rest-server:latest
build:
context: ../..
dockerfile: Dockerfile
Expand Down Expand Up @@ -34,11 +33,11 @@ services:
image: grafana/grafana
volumes:
- grafanadata:/var/lib/grafana
- ./dashboards:/dashboards
- ./grafana.ini:/etc/grafana/grafana.ini
- ./grafana:/etc/grafana
ports:
- "127.0.0.1:8030:3000"
environment:
GF_SECURITY_CSRF_TRUSTED_ORIGINS: grafana.example.com # Put your serving domain here
GF_USERS_DEFAULT_THEME: light
# GF_INSTALL_PLUGINS: grafana-clock-panel,grafana-simple-json-datasource
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "Graph",
"version": ""
},
{
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
Expand Down Expand Up @@ -59,7 +59,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 1,
"legend": {
Expand Down Expand Up @@ -135,7 +135,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 4,
"legend": {
Expand Down Expand Up @@ -223,7 +223,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 2,
"legend": {
Expand Down Expand Up @@ -299,7 +299,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 5,
"legend": {
Expand Down Expand Up @@ -387,7 +387,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 3,
"legend": {
Expand Down Expand Up @@ -463,7 +463,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"fill": 1,
"id": 6,
"legend": {
Expand Down Expand Up @@ -551,7 +551,7 @@
{
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS-INFRA}",
"datasource": "prometheus",
"hide": 0,
"includeAll": false,
"label": "Instance",
Expand Down Expand Up @@ -634,4 +634,4 @@
"timezone": "",
"title": "Restic Rest Server",
"version": 8
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,6 @@ path = /dashboards
# Url used to to import dashboards directly from Grafana.net
[grafana_net]
url = https://grafana.net

[dashboards]
default_home_dashboard_path = /etc/grafana/dashboards/rest-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: 1

providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
allowUiUpdates: true
options:
# Path to dashboard files on disk
path: /etc/grafana/dashboards
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
uid: prometheus
Binary file removed examples/compose-with-grafana/screenshot.png
Binary file not shown.