- Update to version 3.4.2: * fix(ci): do not disable CGO in Makefile (backport release-3.4.x) (#16272) * fix(blooms): Initialize bloom gateway client only once (backport release-3.4.x) (#16268) * docs: Updates Loki release notes for 3.3.3 (backport release-3.4.x) (#16249) * chore(release-3.4.x): release 3.4.1 (#16226) * docs: adding Promtail deprecation banners (backport release-3.4.x) (#16228) * fix: build info in docker images (#16225) * ci: Move IMAGE_TAG Dockerfile ARG into build phase (backport k239) (#16212) * chore(k239): release 3.4.0 (#16102) - refresh proper-data-directories.patch - Update to version 3.4.0: * docs: Release notes for Loki 3.4 (backport k239) (#16209) * docs: add upgrade notes for 3.4.x (backport k239) (#16208) * docs: getting started tutorial - Monitor K8s logs with Loki (backport k239) (#16192) * docs: correctly tag upgrade notes (backport k239) (#16186) * docs(thanos): add migration doc for thanos storage clients (backport k239) (#16183) * fix(promtail): windows forward event crash (backport k239) (#16163) * fix(ci): backport build info fixes into k239 (#16162) * docs(thanos): unhide configuration docs for thanos storage clients (backport k239) (#16142) * chore: Update Golang in CI and build env to 1.23.6 (backport k239) (#16101) * ci: fix docker driver platforms (fixes k239 release) (backport k239) (#16099) * chore(build): Update loki release code for k239 (#16092) * chore: backport distributor constraint changes to k239 (#16066) * fix(deps): update module github.com/aws/aws-sdk-go-v2/service/s3 to v1.74.1 (main) (#15963) * chore(deps): update dependabot/fetch-metadata action to v2.3.0 (main) (#15964) * fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.29.2 (main) (#15962) * docs: Update _index.md: add information about non-blocking mode to the documentation (#15910) * fix(deps): update module google.golang.org/grpc to v1.70.0 (main) (#15955) OBS-URL: https://build.opensuse.org/request/show/1245898 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/loki?expand=0&rev=37
808 lines
27 KiB
Diff
808 lines
27 KiB
Diff
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
|
||
@@ -166,8 +166,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:
|
||
@@ -300,7 +300,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
|
||
@@ -426,8 +426,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:
|
||
@@ -728,7 +728,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
|
||
@@ -882,15 +882,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
|
||
@@ -908,8 +908,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:
|
||
@@ -979,7 +979,7 @@ overrides:
|
||
},
|
||
Ruler: Ruler{
|
||
Enabled: true,
|
||
- RulesStorageDirectory: "/tmp/rules",
|
||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||
EvaluationInterval: "1m",
|
||
PollInterval: "1m",
|
||
AlertManager: &AlertManagerConfig{
|
||
@@ -1088,7 +1088,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
|
||
@@ -1242,15 +1242,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
|
||
@@ -1268,8 +1268,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:
|
||
@@ -1339,7 +1339,7 @@ overrides:
|
||
},
|
||
Ruler: Ruler{
|
||
Enabled: true,
|
||
- RulesStorageDirectory: "/tmp/rules",
|
||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||
EvaluationInterval: "1m",
|
||
PollInterval: "1m",
|
||
AlertManager: &AlertManagerConfig{
|
||
@@ -1449,7 +1449,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
|
||
@@ -1616,15 +1616,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
|
||
@@ -1642,8 +1642,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:
|
||
@@ -1713,7 +1713,7 @@ overrides:
|
||
},
|
||
Ruler: Ruler{
|
||
Enabled: true,
|
||
- RulesStorageDirectory: "/tmp/rules",
|
||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||
EvaluationInterval: "1m",
|
||
PollInterval: "1m",
|
||
AlertManager: &AlertManagerConfig{
|
||
@@ -1840,7 +1840,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
|
||
@@ -1975,8 +1975,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:
|
||
@@ -2181,7 +2181,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
|
||
@@ -2361,15 +2361,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
|
||
@@ -2387,8 +2387,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:
|
||
@@ -2458,7 +2458,7 @@ overrides:
|
||
},
|
||
Ruler: Ruler{
|
||
Enabled: true,
|
||
- RulesStorageDirectory: "/tmp/rules",
|
||
+ RulesStorageDirectory: "/var/lib/loki/rules",
|
||
EvaluationInterval: "1m",
|
||
PollInterval: "1m",
|
||
AlertManager: &AlertManagerConfig{
|
||
@@ -2601,7 +2601,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:
|
||
@@ -2777,8 +2777,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:
|
||
@@ -2948,7 +2948,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
|
||
@@ -3128,15 +3128,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
|
||
@@ -3154,8 +3154,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:
|
||
@@ -3301,7 +3301,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
|
||
@@ -683,15 +683,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
|
||
instance_addr: localhost
|
||
ring:
|
||
kvstore:
|
||
Index: loki/production/ksonnet/loki/config.libsonnet
|
||
===================================================================
|
||
--- loki.orig/production/ksonnet/loki/config.libsonnet
|
||
+++ loki/production/ksonnet/loki/config.libsonnet
|
||
@@ -381,7 +381,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
|
||
@@ -48,9 +48,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
|
||
@@ -37,7 +37,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)
|
||
}
|
||
@@ -46,8 +46,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
|
||
@@ -52,7 +52,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
|
||
@@ -106,7 +106,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
|