Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add rock for loki v3.3.2 #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions 3.3.2/loki-local-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
auth_enabled: false

server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: info
grpc_server_max_concurrent_streams: 1000

common:
instance_addr: 127.0.0.1
path_prefix: /tmp/loki
storage:
filesystem:
chunks_directory: /tmp/loki/chunks
rules_directory: /tmp/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory

query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100

schema_config:
configs:
- from: 2020-10-24
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h

ruler:
alertmanager_url: http://localhost:9093

frontend:
encoding: protobuf

# 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/analytics/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
55 changes: 55 additions & 0 deletions 3.3.2/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -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.3.2"
base: ubuntu@24.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.3.2"
build-snaps:
- go/1.23/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