From c979bc110828b6f6e33acccc46ff9048adadbc3c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:36:26 +0200 Subject: [PATCH] dd --- docker-compose/loki/datasources.j2 | 31 +++++++++++++++++++++++ docker-compose/loki/docker-compose.yml.j2 | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 docker-compose/loki/datasources.j2 diff --git a/docker-compose/loki/datasources.j2 b/docker-compose/loki/datasources.j2 new file mode 100644 index 00000000..c6854173 --- /dev/null +++ b/docker-compose/loki/datasources.j2 @@ -0,0 +1,31 @@ +# Configuration file version +apiVersion: 1 + +# Mark provisioned data sources for deletion if they are no longer in a provisioning file. +# It takes no effect if data sources are already listed in the deleteDatasources section. +prune: true + +# List of data sources to insert/update depending on what's +# available in the database. +datasources: + # Sets the name you use to refer to + # the data source in panels and queries. + - name: Loki + # Sets the data source type. + type: loki + # Sets the access mode, either + # proxy or direct (Server or Browser in the UI). + # Some data sources are incompatible with any setting + # but proxy (Server). + access: direct + # Sets the organization id. Defaults to orgId 1. + orgId: 1 + # Sets the data source's URL, including the + # port. + url: http://loki:3100 + # Sets the version. Used to compare versions when + # updating. Ignored when creating a new data source. + version: 1 + # Allows users to edit data sources from the + # Grafana UI. + editable: false diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 15c94d9d..7d9fff63 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,6 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana + - datasources.j2:/etc/grafana/provisioning/dashboards ports: - "3101:3000" networks: @@ -41,3 +42,4 @@ volumes: # TODO: http://vm-test-2204.mgrote.net:9080/targets + wenn firewall aus # TODO: grafana dashboard und datasource als code? + https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources +# TODO: URLS: http://docker10.mgrote.net:3101/explore?orgId=1&left=%7B%22datasource%22:%22U4h5CxgHz%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22U4h5CxgHz%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D + http://docker10.mgrote.net:3100/ready + http://vm-test-2204.mgrote.net:9080/config