init
This commit is contained in:
commit
f6cdf8ea7c
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 CF
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
56
README.md
Normal file
56
README.md
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Notes
|
||||
|
||||
`git clone https://git.ittavern.com/CaffeineFueled/podman-compose-grafana-loki.git`
|
||||
|
||||
*Github users, feel free to change this URL!*
|
||||
|
||||
`cd podman-compose-grafana-loki`
|
||||
|
||||
`podman compose up -d`
|
||||
|
||||
Taking it down:
|
||||
|
||||
`podman compose down`
|
||||
|
||||
Check status:
|
||||
|
||||
`podman container ps -a`
|
||||
|
||||
> Note: not ready for production!
|
||||
|
||||
## Endpoint
|
||||
|
||||
**Grafana** `http://localhost:3000`
|
||||
|
||||
Check:
|
||||
|
||||
```bash
|
||||
curl -Ls 127.1:3000 | grep '<title>'
|
||||
|
||||
# <title>Grafana</title> ✅
|
||||
```
|
||||
|
||||
**Loki** `http://localhost:3100`
|
||||
|
||||
Check:
|
||||
|
||||
```bash
|
||||
curl -Ls 127.1:3100/ready
|
||||
|
||||
# ready ✅
|
||||
```
|
||||
|
||||
*from the perspective of the host!*
|
||||
|
||||
## Auth
|
||||
|
||||
Open Grafana in your browser, default creds are `admin`/`admin`.
|
||||
|
||||
## Data Source
|
||||
|
||||
Loki should be already available as datasource. Edit `./grafana/datasources/ds.yml` to make changes!
|
||||
|
||||
# TODO
|
||||
|
||||
- [ ] Authentication for Loki
|
||||
- [ ] Add names to the containers (maybe)
|
29
docker-compose.yml
Normal file
29
docker-compose.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
version: "3"
|
||||
|
||||
networks:
|
||||
grafana-loki-net:
|
||||
|
||||
services:
|
||||
loki:
|
||||
image: docker.io/grafana/loki:latest
|
||||
volumes:
|
||||
- ./loki/data:/tmp/loki:U # DATA DIR
|
||||
- ./loki/loki-local-config.yaml:/mnt/config/loki-local-config.yaml:U # CONFIG
|
||||
ports:
|
||||
- "3100:3100"
|
||||
command: --config.file=/mnt/config/loki-local-config.yaml
|
||||
networks:
|
||||
- grafana-loki-net
|
||||
|
||||
grafana:
|
||||
environment:
|
||||
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
|
||||
image: docker.io/grafana/grafana:latest
|
||||
volumes:
|
||||
- ./grafana/grafana.ini:/etc/grafana/grafana.ini:U # INIT SCRIPT
|
||||
- ./grafana/data:/var/lib/grafana:U # DATA DIR
|
||||
- ./grafana/datasources:/etc/grafana/provisioning/datasources:U # DATA SOURCE CONFIG
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- grafana-loki-net
|
4
grafana/data/.gitignore
vendored
Normal file
4
grafana/data/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
*
|
||||
*/
|
||||
!.gitignore
|
||||
!.gitkeep
|
0
grafana/data/.gitkeep
Normal file
0
grafana/data/.gitkeep
Normal file
7
grafana/datasources/ds.yaml
Normal file
7
grafana/datasources/ds.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Loki-Datasource
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
1201
grafana/grafana.ini
Normal file
1201
grafana/grafana.ini
Normal file
File diff suppressed because it is too large
Load diff
4
loki/data/.gitignore
vendored
Normal file
4
loki/data/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
*
|
||||
*/
|
||||
!.gitignore
|
||||
!.gitkeep
|
0
loki/data/.gitkeep
Normal file
0
loki/data/.gitkeep
Normal file
50
loki/loki-local-config.yaml
Normal file
50
loki/loki-local-config.yaml
Normal file
|
@ -0,0 +1,50 @@
|
|||
# Do not use this configuration in production.
|
||||
# It is for demonstration purposes only.
|
||||
auth_enabled: false
|
||||
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
grpc_listen_port: 9096
|
||||
|
||||
common:
|
||||
path_prefix: /tmp/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /tmp/loki/chunks
|
||||
rules_directory: /tmp/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
instance_addr: 127.0.0.1
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2024-10-20
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
ruler:
|
||||
enable_api: true
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
directory: /tmp/loki/rules
|
||||
rule_path: /tmp/loki/rules-temp
|
||||
|
||||
# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
|
||||
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
|
||||
#
|
||||
# Statistics help us better understand how Loki is used, and they show us performance
|
||||
# levels for most users. This helps us prioritize features and documentation.
|
||||
# For more information on what's sent, look at
|
||||
# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go
|
||||
# Refer to the buildReport method to see what goes into a report.
|
||||
#
|
||||
# If you would like to disable reporting, uncomment the following lines:
|
||||
#analytics:
|
||||
# reporting_enabled: false
|
Loading…
Reference in a new issue