mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
container to import grafana dashboards
This commit is contained in:
parent
aca91ac997
commit
32877a10f7
@ -32,7 +32,7 @@ services:
|
|||||||
container_name: prometheus-svc
|
container_name: prometheus-svc
|
||||||
image: prom/prometheus
|
image: prom/prometheus
|
||||||
ports:
|
ports:
|
||||||
- "9090:9090"
|
- "9091:9090"
|
||||||
command: --config.file=/etc/prometheus/prometheus.yaml
|
command: --config.file=/etc/prometheus/prometheus.yaml
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml
|
- ./prometheus.yaml:/etc/prometheus/prometheus.yaml
|
||||||
@ -44,3 +44,17 @@ services:
|
|||||||
- GF_AUTH_BASIC_ENABLED=false
|
- GF_AUTH_BASIC_ENABLED=false
|
||||||
- GF_AUTH_ANONYMOUS_ENABLED=true
|
- GF_AUTH_ANONYMOUS_ENABLED=true
|
||||||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
||||||
|
grafana-dashboards:
|
||||||
|
image: alpine:3.10
|
||||||
|
depends_on:
|
||||||
|
- grafana
|
||||||
|
volumes:
|
||||||
|
- ./grafana-data:/grafana
|
||||||
|
command: >
|
||||||
|
/bin/sh -c "
|
||||||
|
apk add --no-cache curl
|
||||||
|
echo 'waiting for grafana'
|
||||||
|
sleep 5s
|
||||||
|
cd /grafana
|
||||||
|
curl --request POST http://grafana:3000/api/datasources --header 'Content-Type: application/json' -d @datasources.json
|
||||||
|
curl --request POST http://grafana:3000/api/dashboards/db --header 'Content-Type: application/json' -d @dashboard.json"
|
@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"overwrite": true,
|
||||||
|
"dashboard" :
|
||||||
|
|
||||||
{
|
{
|
||||||
"__inputs": [],
|
"__inputs": [],
|
||||||
"__requires": [
|
"__requires": [
|
||||||
@ -42,7 +47,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -121,7 +126,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -214,7 +219,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -293,7 +298,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -386,7 +391,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -465,7 +470,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 9,
|
"h": 9,
|
||||||
@ -558,7 +563,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 8,
|
"h": 8,
|
||||||
@ -637,7 +642,7 @@
|
|||||||
"bars": false,
|
"bars": false,
|
||||||
"dashLength": 10,
|
"dashLength": 10,
|
||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "Prometheus",
|
"datasource": "prometheus",
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 8,
|
"h": 8,
|
||||||
@ -755,4 +760,4 @@
|
|||||||
"title": "Application Telemetry (Prometheus)",
|
"title": "Application Telemetry (Prometheus)",
|
||||||
"uid": "pvXvovKWz",
|
"uid": "pvXvovKWz",
|
||||||
"version": 2
|
"version": 2
|
||||||
}
|
}}
|
6
prometheus-monitoring/grafana-data/datasources.json
Normal file
6
prometheus-monitoring/grafana-data/datasources.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "prometheus",
|
||||||
|
"type": "prometheus",
|
||||||
|
"url": "http://prometheus:9090",
|
||||||
|
"access": "proxy"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user