From c9472080054369fd3f20973b2cb76adf3d3b248a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:51:32 -0400 Subject: [PATCH] chore: add rock for loki v3.1.1 (#36) Co-authored-by: Github Actions --- 3.1.1/loki-local-config.yaml | 50 ++++++++++++++++++++++++++++++++ 3.1.1/rockcraft.yaml | 55 ++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 3.1.1/loki-local-config.yaml create mode 100644 3.1.1/rockcraft.yaml diff --git a/3.1.1/loki-local-config.yaml b/3.1.1/loki-local-config.yaml new file mode 100644 index 0000000..5d2ea84 --- /dev/null +++ b/3.1.1/loki-local-config.yaml @@ -0,0 +1,50 @@ +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 + +query_range: + results_cache: + cache: + embedded_cache: + enabled: true + max_size_mb: 100 + +schema_config: + configs: + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h + +ruler: + alertmanager_url: http://localhost:9093 + +# 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 diff --git a/3.1.1/rockcraft.yaml b/3.1.1/rockcraft.yaml new file mode 100644 index 0000000..a131171 --- /dev/null +++ b/3.1.1/rockcraft.yaml @@ -0,0 +1,55 @@ +name: loki +summary: Loki in a ROCK. +description: "Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus." +version: "3.1.1" +base: ubuntu:22.04 +license: AGPL-3.0 +services: + loki: + command: /bin/loki --config.file=/etc/loki/loki-local-config.yaml + override: replace + startup: enabled +platforms: + amd64: +parts: + loki: + plugin: go + source: https://github.com/grafana/loki + source-type: git + source-tag: "v3.1.1" + build-snaps: + - go/1.21/stable + build-environment: + - BUILD_IN_CONTAINER: "false" + build-packages: + - libsystemd-dev + override-build: | + PROMTAIL_JOURNAL_ENABLED=1 make -j$(grep -c ^processor /proc/cpuinfo) all + install -D -m755 ./cmd/loki/loki ${CRAFT_PART_INSTALL}/usr/bin/loki + install -D -m755 ./cmd/loki-canary/loki-canary ${CRAFT_PART_INSTALL}/usr/bin/loki-canary + install -D -m755 ./cmd/logcli/logcli ${CRAFT_PART_INSTALL}/usr/bin/logcli + install -D -m755 ./clients/cmd/promtail/promtail ${CRAFT_PART_INSTALL}/usr/bin/promtail + stage: + - usr/bin/loki + - usr/bin/loki-canary + - usr/bin/logcli + - usr/bin/promtail + default-config: + plugin: dump + source: . + organize: + loki-local-config.yaml: etc/loki/loki-local-config.yaml + stage: + - etc/loki/loki-local-config.yaml + ca-certs: + plugin: nil + overlay-packages: [ca-certificates] + deb-security-manifest: + plugin: nil + after: + - loki + - ca-certs + override-prime: | + set -x + mkdir -p $CRAFT_PRIME/usr/share/rocks/ + (echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query