From 76df21e79fe42d0e67309777edcbb0d9ad94dc76 Mon Sep 17 00:00:00 2001 From: realkarmakun <20980281+realkarmakun@users.noreply.github.com> Date: Mon, 4 Jul 2022 03:51:38 +0600 Subject: [PATCH] feaT: Add Loki egg (#1606) Co-authored-by: softwarenoob --- README.md | 11 ++++++--- monitoring/loki/README.md | 25 +++++++++++++++++++++ monitoring/loki/egg-loki.json | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 monitoring/loki/README.md create mode 100644 monitoring/loki/egg-loki.json diff --git a/README.md b/README.md index a83e91d3..cd0ac048 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,9 @@ If you are reading this it looks like you are looking to add an egg to your serv * [Airplane](game_eggs/minecraft/java/airplane) * [Cuberite](game_eggs/minecraft/java/cuberite) * [Fabric](game_eggs/minecraft/java/fabric) - * [Feather](game_eggs/minecraft/java/feather) - * [Feed The Beast](game_eggs/minecraft/java/ftb) - * [Forge](game_eggs/minecraft/java/forge) + * [Feather](game_eggs/minecraft/java/feather) + * [Feed The Beast](game_eggs/minecraft/java/ftb) + * [Forge](game_eggs/minecraft/java/forge) * [Glowstone](game_eggs/minecraft/java/glowstone) * [Magma](game_eggs/minecraft/java/magma) * [Mohist](game_eggs/minecraft/java/mohist) @@ -255,6 +255,7 @@ If you are reading this it looks like you are looking to add an egg to your serv * [TShock](game_eggs/terraria/tshock) [Tycoon Games](game_eggs/tycoon_games) + * [OpenRCT2](game_eggs/tycoon_games/openrct2) * [OpenTTD](game_eggs/tycoon_games/openttd) @@ -270,6 +271,10 @@ If you are reading this it looks like you are looking to add an egg to your serv ## [Monitoring](/monitoring/) +### Loki + +* [Loki](/monitoring/loki) + ### Prometheus * [Prometheus](/monitoring/prometheus) diff --git a/monitoring/loki/README.md b/monitoring/loki/README.md new file mode 100644 index 00000000..d99b1be7 --- /dev/null +++ b/monitoring/loki/README.md @@ -0,0 +1,25 @@ +# Loki + +## From the [Loki](https://github.com/grafana/loki) GitHub repository + +Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and easy to operate. + +## Working with Loki + +To get logs "into" Loki you need a scrape agent, such as official [Promtail](https://grafana.com/docs/loki/latest/clients/promtail/installation/) or a library for your app that can push logs through HTTP endpoint (gRPC endpoint is disabled in Docker enviroment by default) + +## Resource consumption + +As this egg sets up Loki in single node mode, it can consume a lot of disk space really fast. It is possible to setup different kind of storages for different parts of Loki files. For further information refer to official [Loki documentation](https://grafana.com/docs/loki/latest/operations/storage/). + +To get started, you can go with a minimum of 3GB RAM and >=2.5GB disk space. + +Keep in mind that those numbers can grow pretty quick! + +## Server Ports + +Ports required to run the server in a table format. + +| Port | default | +|-------------|---------| +| Loki server | 3100 | diff --git a/monitoring/loki/egg-loki.json b/monitoring/loki/egg-loki.json new file mode 100644 index 00000000..04ee7e0a --- /dev/null +++ b/monitoring/loki/egg-loki.json @@ -0,0 +1,42 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2022-07-03T17:40:29-04:00", + "name": "Loki", + "author": "unknown@unknown.com", + "description": "Prometheus but for logs. This egg is for Loki instance only! You usually need pushing agents like Promtail to put logs in this", + "features": null, + "docker_images": { + "ghcr.io\/pterodactyl\/yolks:debian": "ghcr.io\/pterodactyl\/yolks:debian" + }, + "file_denylist": [], + "startup": ".\/loki-linux-amd64 -config.file=loki-docker-config.yaml", + "config": { + "files": "{\r\n \"loki-docker-config.yaml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"server.http_listen_port\": \"{{server.build.default.port}}\",\r\n \"common.ring.instance_addr\": \"0.0.0.0\",\r\n \"common.path_prefix\": \"\/home\/container\/loki\",\r\n \"common.storage.filesystem.chunks_directory\": \"\/home\/container\/loki\/chunks\",\r\n \"common.storage.filesystem.rules_directory\": \"\/home\/container\/loki\/rules\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"Loki started\"\r\n}", + "logs": "{}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n# Switch to mounted working install directory\r\ncd \/mnt\/server\r\n\r\n# Download and extract Loki\r\n\r\nif [ \"$LOKI_VERSION\" = \"latest\" ]; then LOKI_VERSION=$(curl --silent \"https:\/\/api.github.com\/repos\/grafana\/loki\/releases\/latest\" | grep '\"tag_name\":' | sed -E 's\/.*\"([^\"]+)\".*\/\\1\/' | cut -c2-); fi\r\necho -e \"running curl -L https:\/\/github.com\/grafana\/loki\/releases\/download\/v${LOKI_VERSION}\/loki-linux-amd64.zip --output loki-linux-amd64.zip\"\r\ncurl -L https:\/\/github.com\/grafana\/loki\/releases\/download\/v${LOKI_VERSION}\/loki-linux-amd64.zip --output loki-linux-amd64.zip\r\nunzip loki-linux-amd64.zip\r\nrm -rf loki-linux-amd64.zip\r\ncurl -L https:\/\/raw.githubusercontent.com\/grafana\/loki\/v${LOKI_VERSION}\/cmd\/loki\/loki-docker-config.yaml --output loki-docker-config.yaml\r\necho -e \"installation completed\"", + "container": "ghcr.io\/parkervcp\/installers:debian", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "Loki Version", + "description": "The version of Loki to use.\r\n\r\nFind all versions from https:\/\/github.com\/grafana\/loki", + "env_variable": "LOKI_VERSION", + "default_value": "latest", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|max:20", + "field_type": "text" + } + ] +} \ No newline at end of file