From 2fa57996bc741727b3923c823f1bc3075e408b25 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 21 Apr 2024 12:20:52 -0400 Subject: [PATCH] Fixup --- docker/grafana/custom.ini | 11 ---------- docker/grafana/dashboard.json | 17 -------------- docker/grafana/dashboards.yaml | 11 ++++++++++ ...{loki_datasource.yaml => datasources.yaml} | 4 +++- docker/grafana/grafana.ini | 5 +++++ stack.production.yml | 22 ------------------- 6 files changed, 19 insertions(+), 51 deletions(-) delete mode 100644 docker/grafana/custom.ini delete mode 100644 docker/grafana/dashboard.json create mode 100644 docker/grafana/dashboards.yaml rename docker/grafana/{loki_datasource.yaml => datasources.yaml} (53%) create mode 100644 docker/grafana/grafana.ini diff --git a/docker/grafana/custom.ini b/docker/grafana/custom.ini deleted file mode 100644 index 54535e3..0000000 --- a/docker/grafana/custom.ini +++ /dev/null @@ -1,11 +0,0 @@ -datasources: - - name: Loki - type: loki - access: proxy # Access mode: 'proxy' (default) or 'direct' - url: http://loki_loki - jsonData: - maxLines: 1000 # Maximum number of lines returned per query - # basicAuth: - # username: myuser - # password: mypassword -default_home_dashboard = Loki \ No newline at end of file diff --git a/docker/grafana/dashboard.json b/docker/grafana/dashboard.json deleted file mode 100644 index 1c94aa4..0000000 --- a/docker/grafana/dashboard.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "Loki", - "panels": [ - { - "title": "Error Rate", - "type": "graph", - "datasource": "Loki", - "targets": [ - { - "expr": 'sum(rate({job="my-app", level="error"}[1m])) by (level)', - "legendFormat": "{{level}}", - "refId": "A" - } - ] - } - ] - } \ No newline at end of file diff --git a/docker/grafana/dashboards.yaml b/docker/grafana/dashboards.yaml new file mode 100644 index 0000000..dafdd51 --- /dev/null +++ b/docker/grafana/dashboards.yaml @@ -0,0 +1,11 @@ +apiVersion: 1 + +providers: + - name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards/default diff --git a/docker/grafana/loki_datasource.yaml b/docker/grafana/datasources.yaml similarity index 53% rename from docker/grafana/loki_datasource.yaml rename to docker/grafana/datasources.yaml index 4e5d03e..53089a4 100644 --- a/docker/grafana/loki_datasource.yaml +++ b/docker/grafana/datasources.yaml @@ -4,4 +4,6 @@ datasources: - name: Loki type: loki access: proxy - url: http://loki_loki:3100 \ No newline at end of file + url: http://loki_loki:3100 + jsonData: + maxLines: 1000 diff --git a/docker/grafana/grafana.ini b/docker/grafana/grafana.ini new file mode 100644 index 0000000..8b26d56 --- /dev/null +++ b/docker/grafana/grafana.ini @@ -0,0 +1,5 @@ +[server] +domain = grafana.nixc.us + +[auth.anonymous] +enabled = false diff --git a/stack.production.yml b/stack.production.yml index b737a2d..5a0d3d3 100644 --- a/stack.production.yml +++ b/stack.production.yml @@ -2,19 +2,8 @@ version: "3.7" services: loki: image: git.nixc.us/nixius/loki:production-loki - environment: - - PUID=1000 # UID to run the application as - - PGID=1000 # GID to run the application as - - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client. - - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min. - - RTC_CONFIG=false # Set to the path of a file that specifies the STUN/TURN servers. - - DEBUG_MODE=false # Set to true to debug container and peer connections. - - TZ=Etc/UTC # Time Zone deploy: replicas: 1 - # placement: - # constraints: - # - node.hostname == ingress.nixc.us labels: homepage.group: apps homepage.name: loki @@ -36,19 +25,8 @@ services: grafana: image: git.nixc.us/nixius/loki:production-grafana - environment: - - PUID=1000 # UID to run the application as - - PGID=1000 # GID to run the application as - - WS_FALLBACK=false # Set to true to enable websocket fallback if the peer to peer WebRTC connection is not available to the client. - - RATE_LIMIT=false # Set to true to limit clients to 1000 requests per 5 min. - - RTC_CONFIG=false # Set to the path of a file that specifies the STUN/TURN servers. - - DEBUG_MODE=false # Set to true to debug container and peer connections. - - TZ=Etc/UTC # Time Zone deploy: replicas: 1 - # placement: - # constraints: - # - node.hostname == ingress.nixc.us labels: homepage.group: apps homepage.name: grafana