update to 3.3.1, convert to obs_scm, fix builds on s390x/i586/armv7l
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/loki?expand=0&rev=31
This commit is contained in:
commit
8e4d377a72
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
23
_service
Normal file
23
_service
Normal file
@ -0,0 +1,23 @@
|
||||
<services>
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="url">https://github.com/grafana/loki.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="exclude">.git</param>
|
||||
<!-- use this pattern for snapshots
|
||||
<param name="versionformat">@PARENT_TAG@+git@TAG_OFFSET@.%h</param>
|
||||
-->
|
||||
<param name="versionformat">@PARENT_TAG@</param>
|
||||
<param name="revision">v3.3.1</param>
|
||||
<param name="versionrewrite-pattern">v(.*)</param>
|
||||
<param name="submodules">disable</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="set_version" mode="manual">
|
||||
</service>
|
||||
<service name="tar" mode="buildtime">
|
||||
</service>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">loki*.tar</param>
|
||||
<param name="compression">xz</param>
|
||||
</service>
|
||||
</services>
|
6
_servicedata
Normal file
6
_servicedata
Normal file
@ -0,0 +1,6 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">git://github.com/grafana/loki.git</param>
|
||||
<param name="changesrevision">525040a3265715ca8cfb52cd39108ccfac9f8af6</param></service><service name="tar_scm">
|
||||
<param name="url">https://github.com/grafana/loki.git</param>
|
||||
<param name="changesrevision">60f2af32a73b865b614c454725c7688cb12b7bd9</param></service></servicedata>
|
3
loki-2.8.11+git.1711098663.aa89d817.tar.xz
Normal file
3
loki-2.8.11+git.1711098663.aa89d817.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f83f881a668d07b758ed01bf15b1dc934ba4788d4781deb64441adcce1589ea
|
||||
size 28488640
|
3
loki-3.2.1.tar.xz
Normal file
3
loki-3.2.1.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:791f1521ca1160f835c0a181c4c6cc35c2a228ca7e0dcf3ee24cb9d93a1988d1
|
||||
size 39643648
|
3
loki-3.3.1.obscpio
Normal file
3
loki-3.3.1.obscpio
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7b9c32346674083142be0fce7f50f1325949836a1fd87fb1722aac420eb69a6c
|
||||
size 278920206
|
3588
loki.changes
Normal file
3588
loki.changes
Normal file
File diff suppressed because it is too large
Load Diff
4
loki.obsinfo
Normal file
4
loki.obsinfo
Normal file
@ -0,0 +1,4 @@
|
||||
name: loki
|
||||
version: 3.3.1
|
||||
mtime: 1733331692
|
||||
commit: 60f2af32a73b865b614c454725c7688cb12b7bd9
|
27
loki.service
Normal file
27
loki.service
Normal file
@ -0,0 +1,27 @@
|
||||
[Unit]
|
||||
Description=Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system
|
||||
Documentation=https://github.com/grafana/loki
|
||||
|
||||
[Service]
|
||||
# added automatically, for details please see
|
||||
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateDevices=true
|
||||
ProtectHostname=true
|
||||
ProtectClock=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectControlGroups=true
|
||||
RestrictRealtime=true
|
||||
# end of automatic additions
|
||||
Restart=always
|
||||
User=loki
|
||||
EnvironmentFile=-/etc/sysconfig/loki
|
||||
ExecStart=/usr/bin/loki -config.file=${CONFIG_FILE}
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
TimeoutStopSec=20s
|
||||
SendSIGKILL=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
190
loki.spec
Normal file
190
loki.spec
Normal file
@ -0,0 +1,190 @@
|
||||
#
|
||||
# spec file for package loki
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%global loki_datadir /var/lib/loki
|
||||
%global loki_logdir /var/log/loki
|
||||
%global promtail_datadir /var/lib/promtail
|
||||
|
||||
Name: loki
|
||||
Version: 3.3.1
|
||||
Release: 0
|
||||
Summary: Loki: like Prometheus, but for logs
|
||||
License: Apache-2.0
|
||||
Group: System/Monitoring
|
||||
URL: https://grafana.com/loki
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
Source1: loki.service
|
||||
Source2: promtail.service
|
||||
Source3: sysconfig.loki
|
||||
Source4: sysconfig.promtail
|
||||
Source99: series
|
||||
Patch0: proper-data-directories.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: go >= 1.23
|
||||
BuildRequires: golang-packaging
|
||||
BuildRequires: systemd-devel
|
||||
Requires: logcli = %{version}
|
||||
Requires(pre): group(loki)
|
||||
Requires(pre): user(loki)
|
||||
Requires: group(loki)
|
||||
Requires: user(loki)
|
||||
Requires(post): %fillup_prereq
|
||||
%systemd_ordering
|
||||
|
||||
%description
|
||||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation
|
||||
system inspired by Prometheus.
|
||||
|
||||
This package contains the Loki server.
|
||||
|
||||
%package -n promtail
|
||||
Summary: Promtail Client
|
||||
Group: System/Monitoring
|
||||
|
||||
%description -n promtail
|
||||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation
|
||||
system inspired by Prometheus.
|
||||
|
||||
This package contains the Promtail client.
|
||||
|
||||
%package -n logcli
|
||||
Summary: LogCLI tool
|
||||
Group: System/Monitoring
|
||||
|
||||
%description -n logcli
|
||||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation
|
||||
system inspired by Prometheus.
|
||||
|
||||
This package contains the LogCLI command-line tool.
|
||||
|
||||
%package -n lokitool
|
||||
Summary: A command-line tool to manage Loki
|
||||
Group: System/Monitoring
|
||||
|
||||
%description -n lokitool
|
||||
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation
|
||||
system inspired by Prometheus.
|
||||
|
||||
This package contains the lokitool command-line tool.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 %{name}-%{version}
|
||||
|
||||
%build
|
||||
%define buildpkg github.com/grafana/loki/pkg/build
|
||||
DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ"
|
||||
BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
|
||||
|
||||
%ifarch %{ix86} s390 s390x armv7l armv7hl armv7l:armv6l:armv5tel
|
||||
export CGO_ENABLED=1
|
||||
%else
|
||||
export CGO_ENABLED=0
|
||||
%endif
|
||||
|
||||
export GOFLAGS="-mod=vendor -buildmode=pie -tags=netgo"
|
||||
export GOLDFLAGS="-X %{buildpkg}.Version=%{version} \
|
||||
-X %{buildpkg}.Revision=v%{version} \
|
||||
-X %{buildpkg}.Branch=main \
|
||||
-X %{buildpkg}.BuildUser=openSUSE \
|
||||
-X %{buildpkg}.BuildDate=${BUILD_DATE}"
|
||||
|
||||
go build -ldflags="$GOLDFLAGS" ./cmd/loki
|
||||
go build -ldflags="$GOLDFLAGS" ./cmd/logcli
|
||||
go build -ldflags="$GOLDFLAGS" ./cmd/lokitool
|
||||
CGO_ENABLED=1 go build -ldflags="$GOLDFLAGS" --tags=promtail_journal_enabled ./clients/cmd/promtail
|
||||
|
||||
%install
|
||||
|
||||
# Service files for Loki and promtail
|
||||
install -Dm644 %{SOURCE1} %{buildroot}%{_unitdir}/loki.service
|
||||
install -Dm644 %{SOURCE2} %{buildroot}%{_unitdir}/promtail.service
|
||||
install -Dm644 %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.loki
|
||||
install -Dm644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.promtail
|
||||
install -dm755 %{buildroot}%{_sbindir}
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcloki
|
||||
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcpromtail
|
||||
|
||||
# Config files
|
||||
install -Dm640 cmd/loki/loki-local-config.yaml \
|
||||
%{buildroot}%{_sysconfdir}/loki/loki.yaml
|
||||
install -Dm640 clients/cmd/promtail/promtail-local-config.yaml \
|
||||
%{buildroot}%{_sysconfdir}/loki/promtail.yaml
|
||||
|
||||
# Binaries
|
||||
install -dm755 %{buildroot}%{_bindir}
|
||||
install -Dm755 loki %{buildroot}%{_bindir}
|
||||
install -Dm755 lokitool %{buildroot}%{_bindir}
|
||||
install -Dm755 promtail %{buildroot}%{_bindir}
|
||||
install -Dm755 logcli %{buildroot}%{_bindir}
|
||||
|
||||
install -D -d -m 0750 %{buildroot}%{promtail_datadir} %{buildroot}%{loki_datadir} %{buildroot}%{loki_logdir}
|
||||
|
||||
%pre
|
||||
%service_add_pre loki.service
|
||||
|
||||
%post
|
||||
%fillup_only
|
||||
%service_add_post loki.service
|
||||
|
||||
%preun
|
||||
%service_del_preun loki.service
|
||||
|
||||
%postun
|
||||
%service_del_postun loki.service promtail.service
|
||||
|
||||
%pre -n promtail
|
||||
%service_add_pre promtail.service
|
||||
|
||||
%post -n promtail
|
||||
%fillup_only -n promtail
|
||||
%service_add_post promtail.service
|
||||
|
||||
%preun -n promtail
|
||||
%service_del_preun promtail.service
|
||||
|
||||
%postun -n promtail
|
||||
%service_del_postun promtail.service
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_unitdir}/loki.service
|
||||
%{_fillupdir}/sysconfig.loki
|
||||
%{_bindir}/loki
|
||||
%dir %{_sysconfdir}/loki
|
||||
%config(noreplace) %attr(-,root,loki) %{_sysconfdir}/loki/loki.yaml
|
||||
%{_sbindir}/rcloki
|
||||
%dir %attr(-,loki,loki) %{loki_datadir}/
|
||||
%dir %attr(-,loki,loki) %{loki_logdir}/
|
||||
|
||||
%files -n promtail
|
||||
%{_unitdir}/promtail.service
|
||||
%{_fillupdir}/sysconfig.promtail
|
||||
%{_bindir}/promtail
|
||||
%dir %{_sysconfdir}/loki
|
||||
%config(noreplace) %{_sysconfdir}/loki/promtail.yaml
|
||||
%{_sbindir}/rcpromtail
|
||||
%dir %{promtail_datadir}/
|
||||
|
||||
%files -n logcli
|
||||
%{_bindir}/logcli
|
||||
|
||||
%files -n lokitool
|
||||
%{_bindir}/lokitool
|
||||
|
||||
%changelog
|
27
promtail.service
Normal file
27
promtail.service
Normal file
@ -0,0 +1,27 @@
|
||||
[Unit]
|
||||
Description=promtail is the agent responsible for gathering logs and sending them to Loki.
|
||||
Documentation=https://github.com/grafana/loki/blob/master/docs/promtail.md
|
||||
|
||||
[Service]
|
||||
# added automatically, for details please see
|
||||
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateDevices=true
|
||||
ProtectHostname=true
|
||||
ProtectClock=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectControlGroups=true
|
||||
RestrictRealtime=true
|
||||
# end of automatic additions
|
||||
Restart=always
|
||||
User=root
|
||||
EnvironmentFile=-/etc/sysconfig/promtail
|
||||
ExecStart=/usr/bin/promtail -config.file=${CONFIG_FILE}
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
TimeoutStopSec=20s
|
||||
SendSIGKILL=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
807
proper-data-directories.patch
Normal file
807
proper-data-directories.patch
Normal file
@ -0,0 +1,807 @@
|
||||
Index: loki/cmd/loki/loki-local-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/cmd/loki/loki-local-config.yaml
|
||||
+++ loki/cmd/loki/loki-local-config.yaml
|
||||
@@ -8,11 +8,11 @@ server:
|
||||
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
- path_prefix: /tmp/loki
|
||||
+ path_prefix: /var/lib/loki
|
||||
storage:
|
||||
filesystem:
|
||||
- chunks_directory: /tmp/loki/chunks
|
||||
- rules_directory: /tmp/loki/rules
|
||||
+ chunks_directory: /var/lib/loki/chunks
|
||||
+ rules_directory: /var/lib/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
Index: loki/docs/sources/operations/storage/filesystem.md
|
||||
===================================================================
|
||||
--- loki.orig/docs/sources/operations/storage/filesystem.md
|
||||
+++ loki/docs/sources/operations/storage/filesystem.md
|
||||
@@ -13,7 +13,7 @@ Very simply it stores all the objects (c
|
||||
```yaml
|
||||
storage_config:
|
||||
filesystem:
|
||||
- directory: /tmp/loki/
|
||||
+ directory: /var/lib/loki/
|
||||
```
|
||||
|
||||
A folder is created for every tenant all the chunks for one tenant are stored in that directory.
|
||||
Index: loki/clients/cmd/promtail/promtail-cloudflare.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-cloudflare.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-cloudflare.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://localhost:3100/loki/api/v1/push
|
||||
Index: loki/clients/cmd/promtail/promtail-docker-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-docker-config.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-docker-config.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://loki:3100/loki/api/v1/push
|
||||
Index: loki/clients/cmd/promtail/promtail-local-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-local-config.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-local-config.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://localhost:3100/loki/api/v1/push
|
||||
Index: loki/clients/cmd/promtail/promtail-local-limit-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-local-limit-config.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-local-limit-config.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://localhost:3100/loki/api/v1/push
|
||||
Index: loki/clients/cmd/promtail/promtail-local-pubsub-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-local-pubsub-config.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-local-pubsub-config.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://localhost:3100/loki/api/v1/push
|
||||
Index: loki/operator/internal/manifests/internal/config/build_test.go
|
||||
===================================================================
|
||||
--- loki.orig/operator/internal/manifests/internal/config/build_test.go
|
||||
+++ loki/operator/internal/manifests/internal/config/build_test.go
|
||||
@@ -40,7 +40,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -164,8 +164,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -297,7 +297,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -421,8 +421,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -723,7 +723,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -875,15 +875,15 @@ ruler:
|
||||
min_backoff: 30ms
|
||||
max_backoff: 100ms
|
||||
wal:
|
||||
- dir: /tmp/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
truncate_frequency: 60m
|
||||
min_age: 5m
|
||||
max_age: 4h
|
||||
- rule_path: /tmp/loki
|
||||
+ rule_path: /var/lib/loki
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /tmp/rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
ring:
|
||||
kvstore:
|
||||
store: memberlist
|
||||
@@ -901,8 +901,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -972,7 +972,7 @@ overrides:
|
||||
},
|
||||
Ruler: Ruler{
|
||||
Enabled: true,
|
||||
- RulesStorageDirectory: "/tmp/rules",
|
||||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||||
EvaluationInterval: "1m",
|
||||
PollInterval: "1m",
|
||||
AlertManager: &AlertManagerConfig{
|
||||
@@ -1081,7 +1081,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -1233,15 +1233,15 @@ ruler:
|
||||
min_backoff: 30ms
|
||||
max_backoff: 100ms
|
||||
wal:
|
||||
- dir: /tmp/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
truncate_frequency: 60m
|
||||
min_age: 5m
|
||||
max_age: 4h
|
||||
- rule_path: /tmp/loki
|
||||
+ rule_path: /var/lib/loki
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /tmp/rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
ring:
|
||||
kvstore:
|
||||
store: memberlist
|
||||
@@ -1259,8 +1259,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -1330,7 +1330,7 @@ overrides:
|
||||
},
|
||||
Ruler: Ruler{
|
||||
Enabled: true,
|
||||
- RulesStorageDirectory: "/tmp/rules",
|
||||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||||
EvaluationInterval: "1m",
|
||||
PollInterval: "1m",
|
||||
AlertManager: &AlertManagerConfig{
|
||||
@@ -1440,7 +1440,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -1605,15 +1605,15 @@ ruler:
|
||||
min_backoff: 30ms
|
||||
max_backoff: 100ms
|
||||
wal:
|
||||
- dir: /tmp/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
truncate_frequency: 60m
|
||||
min_age: 5m
|
||||
max_age: 4h
|
||||
- rule_path: /tmp/loki
|
||||
+ rule_path: /var/lib/loki
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /tmp/rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
ring:
|
||||
kvstore:
|
||||
store: memberlist
|
||||
@@ -1631,8 +1631,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -1702,7 +1702,7 @@ overrides:
|
||||
},
|
||||
Ruler: Ruler{
|
||||
Enabled: true,
|
||||
- RulesStorageDirectory: "/tmp/rules",
|
||||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||||
EvaluationInterval: "1m",
|
||||
PollInterval: "1m",
|
||||
AlertManager: &AlertManagerConfig{
|
||||
@@ -1829,7 +1829,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
retention_enabled: true
|
||||
retention_delete_delay: 4h
|
||||
retention_delete_worker_count: 50
|
||||
@@ -1962,8 +1962,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -2168,7 +2168,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -2346,15 +2346,15 @@ ruler:
|
||||
min_backoff: 30ms
|
||||
max_backoff: 100ms
|
||||
wal:
|
||||
- dir: /tmp/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
truncate_frequency: 60m
|
||||
min_age: 5m
|
||||
max_age: 4h
|
||||
- rule_path: /tmp/loki
|
||||
+ rule_path: /var/lib/loki
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /tmp/rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
ring:
|
||||
kvstore:
|
||||
store: memberlist
|
||||
@@ -2372,8 +2372,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -2443,7 +2443,7 @@ overrides:
|
||||
},
|
||||
Ruler: Ruler{
|
||||
Enabled: true,
|
||||
- RulesStorageDirectory: "/tmp/rules",
|
||||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||||
EvaluationInterval: "1m",
|
||||
PollInterval: "1m",
|
||||
AlertManager: &AlertManagerConfig{
|
||||
@@ -2586,7 +2586,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
tail_tls_config:
|
||||
@@ -2760,8 +2760,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -2931,7 +2931,7 @@ common:
|
||||
instance_port: 9095
|
||||
compactor:
|
||||
compaction_interval: 2h
|
||||
- working_directory: /tmp/loki/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
frontend:
|
||||
tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
|
||||
compress_responses: true
|
||||
@@ -3109,15 +3109,15 @@ ruler:
|
||||
min_backoff: 30ms
|
||||
max_backoff: 100ms
|
||||
wal:
|
||||
- dir: /tmp/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
truncate_frequency: 60m
|
||||
min_age: 5m
|
||||
max_age: 4h
|
||||
- rule_path: /tmp/loki
|
||||
+ rule_path: /var/lib/loki
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /tmp/rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
ring:
|
||||
kvstore:
|
||||
store: memberlist
|
||||
@@ -3135,8 +3135,8 @@ server:
|
||||
log_level: info
|
||||
storage_config:
|
||||
boltdb_shipper:
|
||||
- active_index_directory: /tmp/loki/index
|
||||
- cache_location: /tmp/loki/index_cache
|
||||
+ active_index_directory: /var/lib/loki/index
|
||||
+ cache_location: /var/lib/loki/index_cache
|
||||
cache_ttl: 24h
|
||||
resync_interval: 5m
|
||||
index_gateway_client:
|
||||
@@ -3282,7 +3282,7 @@ overrides:
|
||||
},
|
||||
Ruler: Ruler{
|
||||
Enabled: true,
|
||||
- RulesStorageDirectory: "/tmp/rules",
|
||||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||||
EvaluationInterval: "1m",
|
||||
PollInterval: "1m",
|
||||
|
||||
Index: loki/clients/pkg/promtail/promtail_test.go
|
||||
===================================================================
|
||||
--- loki.orig/clients/pkg/promtail/promtail_test.go
|
||||
+++ loki/clients/pkg/promtail/promtail_test.go
|
||||
@@ -55,7 +55,7 @@ func TestPromtail(t *testing.T) {
|
||||
util_log.Logger = logger
|
||||
|
||||
testutils.InitRandom()
|
||||
- dirName := filepath.Join(os.TempDir(), "/promtail_test_"+testutils.RandName())
|
||||
+ dirName := "/var/lib/promtail_test_" + randName()
|
||||
positionsFileName := dirName + "/positions.yml"
|
||||
|
||||
err := os.MkdirAll(dirName, 0o750)
|
||||
Index: loki/operator/docs/enhancements/ruler_support.md
|
||||
===================================================================
|
||||
--- loki.orig/operator/docs/enhancements/ruler_support.md
|
||||
+++ loki/operator/docs/enhancements/ruler_support.md
|
||||
@@ -769,7 +769,7 @@ spec:
|
||||
volumeMounts:
|
||||
- name: "rules"
|
||||
volume: "rules"
|
||||
- path: "/tmp/rules"
|
||||
+ path: "/var/lib/loki/rules"
|
||||
volumes:
|
||||
- name: "rules"
|
||||
items:
|
||||
@@ -786,7 +786,7 @@ spec:
|
||||
In turn the rules directory is outlined as such:
|
||||
|
||||
```
|
||||
-/tmp/rules/application/ns-a-alerting-rule-a-kube-uid-a.yaml
|
||||
+/var/lib/loki/rules/application/ns-a-alerting-rule-a-kube-uid-a.yaml
|
||||
/application/ns-a-recording-rule-a-kube-uid-b.yaml
|
||||
/infrastructure/ns-b-alerting-rule-b-kube-uid-c.yaml
|
||||
/infrastructure/ns-b-recording-rule-b-kube-uid-d.yaml
|
||||
Index: loki/pkg/logcli/client/file_test.go
|
||||
===================================================================
|
||||
--- loki.orig/pkg/logcli/client/file_test.go
|
||||
+++ loki/pkg/logcli/client/file_test.go
|
||||
@@ -20,8 +20,8 @@ func TestFileClient_QueryRangeLogQueries
|
||||
input := []string{
|
||||
`level=info event="loki started" caller=main.go ts=1625995076`,
|
||||
`level=info event="runtime loader started" caller=main.go ts=1625995077`,
|
||||
- `level=error event="unable to read rules directory" file="/tmp/rules" caller=rules.go ts=1625995090`,
|
||||
- `level=error event="failed to apply wal" error="/tmp/wal/ corrupted" caller=wal.go ts=1625996090`,
|
||||
+ `level=error event="unable to read rules directory" file="/var/lib/loki/rules" caller=rules.go ts=1625995090`,
|
||||
+ `level=error event="failed to apply wal" error="/var/lib/loki/wal/ corrupted" caller=wal.go ts=1625996090`,
|
||||
`level=info event="loki ready" caller=main.go ts=1625996095`,
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ func TestFileClient_Query(t *testing.T)
|
||||
input := []string{
|
||||
`level=info event="loki started" caller=main.go ts=1625995076`,
|
||||
`level=info event="runtime loader started" caller=main.go ts=1625995077`,
|
||||
- `level=error event="unable to read rules directory" file="/tmp/rules" caller=rules.go ts=1625995090`,
|
||||
- `level=error event="failed to apply wal" error="/tmp/wal/ corrupted" caller=wal.go ts=1625996090`,
|
||||
+ `level=error event="unable to read rules directory" file="/var/lib/loki/rules" caller=rules.go ts=1625995090`,
|
||||
+ `level=error event="failed to apply wal" error="/var/lib/loki/wal/ corrupted" caller=wal.go ts=1625996090`,
|
||||
`level=info event="loki ready" caller=main.go ts=1625996095`,
|
||||
}
|
||||
|
||||
Index: loki/pkg/loki/config_wrapper_test.go
|
||||
===================================================================
|
||||
--- loki.orig/pkg/loki/config_wrapper_test.go
|
||||
+++ loki/pkg/loki/config_wrapper_test.go
|
||||
@@ -561,15 +561,15 @@ memberlist:
|
||||
fsConfig := `common:
|
||||
storage:
|
||||
filesystem:
|
||||
- chunks_directory: /tmp/chunks
|
||||
- rules_directory: /tmp/rules`
|
||||
+ chunks_directory: /var/lib/loki/chunks
|
||||
+ rules_directory: /var/lib/loki/rules`
|
||||
|
||||
config, defaults := testContext(fsConfig, nil)
|
||||
|
||||
assert.Equal(t, "local", config.Ruler.StoreConfig.Type)
|
||||
|
||||
- assert.Equal(t, "/tmp/rules", config.Ruler.StoreConfig.Local.Directory)
|
||||
- assert.Equal(t, "/tmp/chunks", config.StorageConfig.FSConfig.Directory)
|
||||
+ assert.Equal(t, "/var/lib/loki/rules", config.Ruler.StoreConfig.Local.Directory)
|
||||
+ assert.Equal(t, "/var/lib/loki/chunks", config.StorageConfig.FSConfig.Directory)
|
||||
|
||||
// should remain empty
|
||||
assert.EqualValues(t, defaults.Ruler.StoreConfig.GCS, config.Ruler.StoreConfig.GCS)
|
||||
Index: loki/pkg/loki/loki_test.go
|
||||
===================================================================
|
||||
--- loki.orig/pkg/loki/loki_test.go
|
||||
+++ loki/pkg/loki/loki_test.go
|
||||
@@ -187,7 +187,7 @@ server:
|
||||
grpc_listen_port: %d
|
||||
common:
|
||||
compactor_address: http://localhost:%d
|
||||
- path_prefix: /tmp/loki
|
||||
+ path_prefix: /var/lib/loki
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
Index: loki/production/ksonnet/loki/config.libsonnet
|
||||
===================================================================
|
||||
--- loki.orig/production/ksonnet/loki/config.libsonnet
|
||||
+++ loki/production/ksonnet/loki/config.libsonnet
|
||||
@@ -374,7 +374,7 @@
|
||||
},
|
||||
|
||||
ruler: if $._config.ruler_enabled then {
|
||||
- rule_path: '/tmp/rules',
|
||||
+ rule_path: '/var/lib/loki/rules',
|
||||
enable_api: true,
|
||||
alertmanager_url: 'http://alertmanager.%s.svc.cluster.local/alertmanager' % $._config.namespace,
|
||||
enable_sharding: true,
|
||||
Index: loki/production/nomad/loki-distributed/config.yml
|
||||
===================================================================
|
||||
--- loki.orig/production/nomad/loki-distributed/config.yml
|
||||
+++ loki/production/nomad/loki-distributed/config.yml
|
||||
@@ -113,7 +113,7 @@ ruler:
|
||||
enable_alertmanager_v2: true
|
||||
enable_api: true
|
||||
external_url: https://loki-ruler.service.consul
|
||||
- rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
|
||||
+ rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
Index: loki/production/nomad/loki-simple/config.yml
|
||||
===================================================================
|
||||
--- loki.orig/production/nomad/loki-simple/config.yml
|
||||
+++ loki/production/nomad/loki-simple/config.yml
|
||||
@@ -64,7 +64,7 @@ ruler:
|
||||
enable_alertmanager_v2: true
|
||||
enable_api: true
|
||||
external_url: https://loki.service.consul
|
||||
- rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
|
||||
+ rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
Index: loki/production/nomad/loki/config.yml
|
||||
===================================================================
|
||||
--- loki.orig/production/nomad/loki/config.yml
|
||||
+++ loki/production/nomad/loki/config.yml
|
||||
@@ -64,7 +64,7 @@ ruler:
|
||||
enable_alertmanager_v2: true
|
||||
enable_api: true
|
||||
external_url: https://loki.service.consul
|
||||
- rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
|
||||
+ rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
Index: loki/clients/cmd/promtail/promtail-journal.yaml
|
||||
===================================================================
|
||||
--- loki.orig/clients/cmd/promtail/promtail-journal.yaml
|
||||
+++ loki/clients/cmd/promtail/promtail-journal.yaml
|
||||
@@ -3,7 +3,7 @@ server:
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://localhost:3100/loki/api/v1/push
|
||||
Index: loki/docs/sources/operations/troubleshooting.md
|
||||
===================================================================
|
||||
--- loki.orig/docs/sources/operations/troubleshooting.md
|
||||
+++ loki/docs/sources/operations/troubleshooting.md
|
||||
@@ -35,7 +35,7 @@ Promtail yet. There may be one of many r
|
||||
them off. Here is what you can do:
|
||||
- Start Promtail after Loki, e.g., 60 seconds later.
|
||||
- To force Promtail to re-send log messages, delete the positions file
|
||||
- (default location `/tmp/positions.yaml`).
|
||||
+ (default location `/var/lib/promtail/positions.yaml`).
|
||||
- Promtail is ignoring targets and isn't reading any logs because of a
|
||||
configuration issue.
|
||||
- This can be detected by turning on debug logging in Promtail and looking
|
||||
Index: loki/examples/promtail-heroku/config.yml
|
||||
===================================================================
|
||||
--- loki.orig/examples/promtail-heroku/config.yml
|
||||
+++ loki/examples/promtail-heroku/config.yml
|
||||
@@ -4,7 +4,7 @@ server:
|
||||
log_level: "info"
|
||||
|
||||
positions:
|
||||
- filename: /tmp/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
|
||||
# This bit indicates what Loki instance to write the logs to. We’ll inject the
|
||||
# details and credentials through environment variables
|
||||
Index: loki/operator/hack/addons_dev.yaml
|
||||
===================================================================
|
||||
--- loki.orig/operator/hack/addons_dev.yaml
|
||||
+++ loki/operator/hack/addons_dev.yaml
|
||||
@@ -87,7 +87,7 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /etc/promtail
|
||||
name: config
|
||||
- - mountPath: /tmp/promtail
|
||||
+ - mountPath: /var/lib/promtail
|
||||
name: run
|
||||
- mountPath: /var/lib/docker/containers
|
||||
name: docker
|
||||
@@ -151,7 +151,7 @@ data:
|
||||
batchwait: 10s
|
||||
timeout: 10s
|
||||
positions:
|
||||
- filename: /tmp/promtail/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
grpc_listen_port: 9095
|
||||
Index: loki/operator/hack/addons_ocp.yaml
|
||||
===================================================================
|
||||
--- loki.orig/operator/hack/addons_ocp.yaml
|
||||
+++ loki/operator/hack/addons_ocp.yaml
|
||||
@@ -84,7 +84,7 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /etc/promtail
|
||||
name: config
|
||||
- - mountPath: /tmp/promtail
|
||||
+ - mountPath: /var/lib/promtail
|
||||
name: run
|
||||
- mountPath: /var/lib/docker/containers
|
||||
name: docker
|
||||
@@ -147,7 +147,7 @@ data:
|
||||
batchwait: 10s
|
||||
timeout: 10s
|
||||
positions:
|
||||
- filename: /tmp/promtail/positions.yaml
|
||||
+ filename: /var/lib/promtail/positions.yaml
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
grpc_listen_port: 9095
|
||||
Index: loki/operator/internal/manifests/var.go
|
||||
===================================================================
|
||||
--- loki.orig/operator/internal/manifests/var.go
|
||||
+++ loki/operator/internal/manifests/var.go
|
||||
@@ -47,9 +47,9 @@ const (
|
||||
storageVolumeName = "storage"
|
||||
rulePartsSeparator = "___"
|
||||
|
||||
- walDirectory = "/tmp/wal"
|
||||
- dataDirectory = "/tmp/loki"
|
||||
- rulesStorageDirectory = "/tmp/rules"
|
||||
+ walDirectory = "/var/lib/loki/wal"
|
||||
+ dataDirectory = "/var/lib/loki"
|
||||
+ rulesStorageDirectory = "/var/lib/loki/rules"
|
||||
|
||||
rulerContainerName = "loki-ruler"
|
||||
|
||||
Index: loki/pkg/storage/hack/main.go
|
||||
===================================================================
|
||||
--- loki.orig/pkg/storage/hack/main.go
|
||||
+++ loki/pkg/storage/hack/main.go
|
||||
@@ -36,7 +36,7 @@ var (
|
||||
func main() {
|
||||
cm := storage.NewClientMetrics()
|
||||
defer cm.Unregister()
|
||||
- if _, err := os.Stat("/tmp/benchmark/chunks"); os.IsNotExist(err) {
|
||||
+ if _, err := os.Stat("/var/lib/loki/benchmark/chunks"); os.IsNotExist(err) {
|
||||
if err := fillStore(cm); err != nil {
|
||||
log.Fatal("error filling up storage:", err)
|
||||
}
|
||||
@@ -45,8 +45,8 @@ func main() {
|
||||
|
||||
func getStore(cm storage.ClientMetrics) (storage.Store, *config.SchemaConfig, error) {
|
||||
storeConfig := storage.Config{
|
||||
- BoltDBConfig: local.BoltDBConfig{Directory: "/tmp/benchmark/index"},
|
||||
- FSConfig: local.FSConfig{Directory: "/tmp/benchmark/chunks"},
|
||||
+ BoltDBConfig: local.BoltDBConfig{Directory: "/var/lib/loki/benchmark/index"},
|
||||
+ FSConfig: local.FSConfig{Directory: "/var/lib/loki/benchmark/chunks"},
|
||||
}
|
||||
|
||||
schemaCfg := config.SchemaConfig{
|
||||
Index: loki/pkg/storage/store_test.go
|
||||
===================================================================
|
||||
--- loki.orig/pkg/storage/store_test.go
|
||||
+++ loki/pkg/storage/store_test.go
|
||||
@@ -51,7 +51,7 @@ var (
|
||||
m runtime.MemStats
|
||||
ctx = user.InjectOrgID(context.Background(), "fake")
|
||||
cm = NewClientMetrics()
|
||||
- chunkStore = getLocalStore("/tmp/benchmark/", cm)
|
||||
+ chunkStore = getLocalStore("/var/lib/loki/benchmark/", cm)
|
||||
)
|
||||
|
||||
// go test -bench=. -benchmem -memprofile memprofile.out -cpuprofile profile.out
|
||||
@@ -105,7 +105,7 @@ func Benchmark_store_SelectLogsBackward(
|
||||
})
|
||||
}
|
||||
|
||||
-// rm -Rf /tmp/benchmark/chunks/ /tmp/benchmark/index
|
||||
+// rm -Rf /var/lib/loki/benchmark/chunks/ /var/lib/loki/benchmark/index
|
||||
// go run -mod=vendor ./pkg/storage/hack/main.go
|
||||
// go test -benchmem -run=^$ -mod=vendor ./pkg/storage -bench=Benchmark_store_SelectSample -memprofile memprofile.out -cpuprofile cpuprofile.out
|
||||
func Benchmark_store_SelectSample(b *testing.B) {
|
||||
Index: loki/vendor/github.com/baidubce/bce-sdk-go/util/log/logger.go
|
||||
===================================================================
|
||||
--- loki.orig/vendor/github.com/baidubce/bce-sdk-go/util/log/logger.go
|
||||
+++ loki/vendor/github.com/baidubce/bce-sdk-go/util/log/logger.go
|
||||
@@ -18,7 +18,7 @@
|
||||
// log to file with rotating. It is safe to be called by multiple goroutines.
|
||||
// By using the package level function to use the default logger:
|
||||
// log.SetLogHandler(log.STDOUT | log.FILE) // default is log to stdout
|
||||
-// log.SetLogDir("/tmp") // default is /tmp
|
||||
+// log.SetLogDir("/var/lib/loki") // default is /var/lib/loki
|
||||
// log.SetRotateType(log.ROTATE_DAY) // default is log.HOUR
|
||||
// log.SetRotateSize(1 << 30) // default is 1GB
|
||||
// log.SetLogLevel(log.INFO) // default is log.DEBUG
|
||||
@@ -67,7 +67,7 @@ const (
|
||||
|
||||
DEFAULT_ROTATE_TYPE = ROTATE_HOUR
|
||||
DEFAULT_ROTATE_SIZE int64 = 1 << 30
|
||||
- DEFAULT_LOG_DIR = "/tmp"
|
||||
+ DEFAULT_LOG_DIR = "/var/lib/loki"
|
||||
ROTATE_SIZE_FILE_PREFIX = "rotating"
|
||||
)
|
||||
|
||||
Index: loki/examples/getting-started/loki-config.yaml
|
||||
===================================================================
|
||||
--- loki.orig/examples/getting-started/loki-config.yaml
|
||||
+++ loki/examples/getting-started/loki-config.yaml
|
||||
@@ -22,7 +22,7 @@ schema_config:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
common:
|
||||
- path_prefix: /loki
|
||||
+ path_prefix: /var/lib/loki
|
||||
replication_factor: 1
|
||||
compactor_address: http://backend:3100
|
||||
storage:
|
||||
@@ -42,4 +42,4 @@ ruler:
|
||||
bucketnames: loki-ruler
|
||||
|
||||
compactor:
|
||||
- working_directory: /tmp/compactor
|
||||
\ No newline at end of file
|
||||
+ working_directory: /var/lib/loki/compactor
|
||||
Index: loki/production/docker/config/loki.yaml
|
||||
===================================================================
|
||||
--- loki.orig/production/docker/config/loki.yaml
|
||||
+++ loki/production/docker/config/loki.yaml
|
||||
@@ -8,7 +8,7 @@ server:
|
||||
log_level: info
|
||||
|
||||
common:
|
||||
- path_prefix: /loki
|
||||
+ path_prefix: /var/lib/loki
|
||||
compactor_address: http://loki-backend:3100
|
||||
replication_factor: 3
|
||||
|
||||
@@ -42,7 +42,7 @@ ingester:
|
||||
chunk_idle_period: 1m
|
||||
wal:
|
||||
enabled: true
|
||||
- dir: /loki/wal
|
||||
+ dir: /var/lib/loki/wal
|
||||
max_chunk_age: 1m
|
||||
chunk_retain_period: 30s
|
||||
chunk_encoding: snappy
|
||||
@@ -54,7 +54,7 @@ ruler:
|
||||
enable_api: true
|
||||
enable_sharding: true
|
||||
wal:
|
||||
- dir: /loki/ruler-wal
|
||||
+ dir: /var/lib/loki/ruler-wal
|
||||
evaluation:
|
||||
mode: remote
|
||||
query_frontend:
|
||||
@@ -62,8 +62,8 @@ ruler:
|
||||
storage:
|
||||
type: local
|
||||
local:
|
||||
- directory: /loki/rules
|
||||
- rule_path: /loki/prom-rules
|
||||
+ directory: /var/lib/loki/rules
|
||||
+ rule_path: /var/lkib/loki/prom-rules
|
||||
remote_write:
|
||||
enabled: true
|
||||
clients:
|
||||
@@ -139,4 +139,4 @@ querier:
|
||||
query_ingesters_within: 2h
|
||||
|
||||
compactor:
|
||||
- working_directory: /tmp/compactor
|
||||
+ working_directory: /var/lib/loki/compactor
|
10
sysconfig.loki
Normal file
10
sysconfig.loki
Normal file
@ -0,0 +1,10 @@
|
||||
## Path: System/Monitoring/Loki
|
||||
## Description: Loki logging server settings
|
||||
|
||||
## Type: string
|
||||
## Default: "/etc/loki/loki.yaml"
|
||||
## ServiceRestart: loki
|
||||
#
|
||||
# Command line options for loki
|
||||
#
|
||||
CONFIG_FILE="/etc/loki/loki.yaml"
|
10
sysconfig.promtail
Normal file
10
sysconfig.promtail
Normal file
@ -0,0 +1,10 @@
|
||||
## Path: System/Monitoring/Promtail
|
||||
## Description: Promtail logging agent settings
|
||||
|
||||
## Type: string
|
||||
## Default: "/etc/loki/promtail.yaml"
|
||||
## ServiceRestart: promtail
|
||||
#
|
||||
# Command line options for promtail
|
||||
#
|
||||
CONFIG_FILE="/etc/loki/promtail.yaml"
|
Loading…
x
Reference in New Issue
Block a user