Blame proper-data-directories.patch

2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/cmd/loki/loki-local-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/cmd/loki/loki-local-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/cmd/loki/loki-local-config.yaml
a24c53
@@ -5,11 +5,11 @@ server:
a24c53
   grpc_listen_port: 9096
a24c53
 
a24c53
 common:
a24c53
-  path_prefix: /tmp/loki
a24c53
+  path_prefix: /var/lib/loki
a24c53
   storage:
a24c53
     filesystem:
a24c53
-      chunks_directory: /tmp/loki/chunks
a24c53
-      rules_directory: /tmp/loki/rules
a24c53
+      chunks_directory: /var/lib/loki/chunks
a24c53
+      rules_directory: /var/lib/loki/rules
a24c53
   replication_factor: 1
a24c53
   ring:
a24c53
     instance_addr: 127.0.0.1
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/configuration/examples.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples.md
2774b6
@@ -150,7 +150,7 @@ storage_config:
2774b6
     secret_access_key: secret_access_key
2774b6
 
2774b6
 compactor:
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
   shared_store: bos
2774b6
 ```
2774b6
 
2774b6
@@ -179,7 +179,7 @@ storage_config:
a24c53
     keyspace: lokiindex
a24c53
 
a24c53
   filesystem:
a24c53
-    directory: /tmp/loki/chunks
a24c53
+    directory: /var/lib/loki/chunks
a24c53
     
a24c53
 ```
a24c53
 
2774b6
@@ -215,10 +215,10 @@ schema_config:
a24c53
 
a24c53
 storage_config:
a24c53
   boltdb:
a24c53
-    directory: /tmp/loki/index
a24c53
+    directory: /var/lib/loki/index
a24c53
 
a24c53
   filesystem:
a24c53
-    directory: /tmp/loki/chunks
a24c53
+    directory: /var/lib/loki/chunks
a24c53
 
a24c53
 limits_config:
a24c53
   enforce_metric_name: false
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/cassandra-index.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/configuration/examples/cassandra-index.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/cassandra-index.yaml
a24c53
@@ -19,5 +19,5 @@ storage_config:
a24c53
     keyspace: lokiindex
a24c53
 
a24c53
   filesystem:
a24c53
-    directory: /tmp/loki/chunks
a24c53
-    
a24c53
\ No newline at end of file
a24c53
+    directory: /var/lib/loki/chunks
a24c53
+
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/complete-local-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/configuration/examples/complete-local-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/complete-local-config.yaml
a24c53
@@ -26,10 +26,10 @@ schema_config:
a24c53
 
a24c53
 storage_config:
a24c53
   boltdb:
a24c53
-    directory: /tmp/loki/index
a24c53
+    directory: /var/lib/loki/index
a24c53
 
a24c53
   filesystem:
a24c53
-    directory: /tmp/loki/chunks
a24c53
+    directory: /var/lib/loki/chunks
a24c53
 
a24c53
 limits_config:
a24c53
   enforce_metric_name: false
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/operations/storage/filesystem.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/operations/storage/filesystem.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/operations/storage/filesystem.md
a24c53
@@ -10,7 +10,7 @@ Very simply it stores all the objects (c
a24c53
 ```yaml
a24c53
 storage_config:
a24c53
   filesystem:
a24c53
-    directory: /tmp/loki/
a24c53
+    directory: /var/lib/loki/
a24c53
 ```
a24c53
 
a24c53
 A folder is created for every tenant all the chunks for one tenant are stored in that directory.
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/rules/_index.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/rules/_index.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/rules/_index.md
2774b6
@@ -18,7 +18,7 @@ ruler:
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
-      directory: /tmp/rules
2774b6
+      directory: /var/lib/loki/rules
2774b6
   rule_path: /tmp/scratch
2774b6
   alertmanager_url: http://localhost
2774b6
   ring:
2774b6
@@ -245,7 +245,7 @@ ruler:
2774b6
             consul:
2774b6
                 host: consul.loki-dev.svc.cluster.local:8500
2774b6
             store: consul
2774b6
-    rule_path: /tmp/rules
2774b6
+    rule_path: /var/lib/loki/rules
2774b6
     storage:
2774b6
         gcs:
2774b6
             bucket_name: <loki-rules-bucket>
a24c53
@@ -260,12 +260,12 @@ The local implementation reads the rule
a24c53
 A typical local configuration might look something like:
a24c53
 ```
a24c53
   -ruler.storage.type=local
a24c53
-  -ruler.storage.local.directory=/tmp/loki/rules
a24c53
+  -ruler.storage.local.directory=/var/lib/loki/rules
a24c53
 ```
a24c53
 
a24c53
 With the above configuration, the Ruler would expect the following layout:
a24c53
 ```
a24c53
-/tmp/loki/rules/<tenant id>/rules1.yaml
a24c53
+/var/lib/loki/rules/<tenant id>/rules1.yaml
a24c53
                            /rules2.yaml
a24c53
 ```
a24c53
 Yaml files are expected to be [Prometheus compatible](#Prometheus_Compatible) but include LogQL expressions as specified in the beginning of this doc.
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/upgrading/_index.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/upgrading/_index.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/upgrading/_index.md
2774b6
@@ -875,8 +875,8 @@ Not every environment will allow this ca
a24c53
 In 1.4.0 and earlier the included config file in the docker container was using directories:
a24c53
 
a24c53
 ```
a24c53
-/tmp/loki/index
a24c53
-/tmp/loki/chunks
a24c53
+/var/lib/loki/index
a24c53
+/var/lib/loki/chunks
a24c53
 ```
a24c53
 
a24c53
 In 1.5.0 this has changed:
2774b6
@@ -892,9 +892,9 @@ This will mostly affect anyone using doc
a24c53
 
a24c53
 One possible upgrade path would look like this:
a24c53
 
a24c53
-If I were running Loki with this command `docker run -d --name=loki --mount source=loki-data,target=/tmp/loki -p 3100:3100 grafana/loki:1.4.0`
a24c53
+If I were running Loki with this command `docker run -d --name=loki --mount source=loki-data,target=/var/lib/loki -p 3100:3100 grafana/loki:1.4.0`
a24c53
 
a24c53
-This would mount a docker volume named `loki-data` to the `/tmp/loki` folder which is where Loki will persist the `index` and `chunks` folder in 1.4.0
a24c53
+This would mount a docker volume named `loki-data` to the `/var/lib/loki` folder which is where Loki will persist the `index` and `chunks` folder in 1.4.0
a24c53
 
a24c53
 To move to 1.5.0 I can do the following (please note that your container names and paths and volumes etc may be different):
a24c53
 
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/operator/internal/manifests/distributor.go
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/operator/internal/manifests/distributor.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/operator/internal/manifests/distributor.go
2774b6
@@ -19,9 +19,9 @@ const (
2774b6
 	configVolumeName       = "config"
2774b6
 	rulesStorageVolumeName = "rules"
2774b6
 	storageVolumeName      = "storage"
2774b6
-	walDirectory           = "/tmp/wal"
2774b6
-	dataDirectory          = "/tmp/loki"
2774b6
-	rulesStorageDirectory  = "/tmp/rules"
2774b6
+	walDirectory           = "/var/lib/loki/wal"
2774b6
+	dataDirectory          = "/var/lib/loki"
2774b6
+	rulesStorageDirectory  = "/var/lib/loki/rules"
2774b6
 	secretDirectory        = "/etc/proxy/secrets"
a24c53
 )
a24c53
 
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-cloudflare.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/cmd/promtail/promtail-cloudflare.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-cloudflare.yaml
a24c53
@@ -3,7 +3,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://localhost:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-docker-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/cmd/promtail/promtail-docker-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-docker-config.yaml
a24c53
@@ -3,7 +3,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://loki:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/cmd/promtail/promtail-local-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-config.yaml
a24c53
@@ -3,7 +3,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://localhost:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-limit-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/cmd/promtail/promtail-local-limit-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-limit-config.yaml
a24c53
@@ -3,7 +3,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://localhost:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-pubsub-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/cmd/promtail/promtail-local-pubsub-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/cmd/promtail/promtail-local-pubsub-config.yaml
a24c53
@@ -3,7 +3,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://localhost:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/clients/lambda-promtail/_index.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/clients/lambda-promtail/_index.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/clients/lambda-promtail/_index.md
2774b6
@@ -140,7 +140,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://ip_or_hostname_where_Loki_run:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/clients/promtail/configuration.md
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/clients/promtail/configuration.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/clients/promtail/configuration.md
2774b6
@@ -1884,7 +1884,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://ip_or_hostname_where_loki_runs:3100/loki/api/v1/push
2774b6
@@ -1910,7 +1910,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://loki_addr:3100/loki/api/v1/push
2774b6
@@ -1936,7 +1936,7 @@ server:
a24c53
   grpc_listen_port: 0
a24c53
 
a24c53
 positions:
a24c53
-  filename: /tmp/positions.yaml
a24c53
+  filename: /var/lib/promtail/positions.yaml
a24c53
 
a24c53
 clients:
a24c53
   - url: http://ip_or_hostname_where_Loki_run:3100/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/production/docker/config/promtail-gateway.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/production/docker/config/promtail-gateway.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/production/docker/config/promtail-gateway.yaml
a24c53
@@ -4,7 +4,7 @@ server:
a24c53
     log_level: "debug"
a24c53
   
a24c53
 positions:
a24c53
-    filename: /tmp/positions.yaml
a24c53
+    filename: /var/lib/promtail/positions.yaml
a24c53
   
a24c53
 clients:
a24c53
     - url: http://loki-gateway:80/loki/api/v1/push
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/bos-config.yaml
a24c53
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/docs/sources/configuration/examples/bos-config.yaml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/docs/sources/configuration/examples/bos-config.yaml
2774b6
@@ -21,5 +21,5 @@ storage_config:
2774b6
     secret_access_key: secret_access_key
2774b6
 
2774b6
 compactor:
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
   shared_store: bos
2774b6
\ No newline at end of file
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/operator/internal/manifests/internal/config/build_test.go
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/operator/internal/manifests/internal/config/build_test.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/operator/internal/manifests/internal/config/build_test.go
2774b6
@@ -28,7 +28,7 @@ common:
2774b6
       s3forcepathstyle: true
2774b6
 compactor:
2774b6
   compaction_interval: 2h
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
 frontend:
2774b6
   tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
2774b6
   compress_responses: true
2774b6
@@ -60,7 +60,7 @@ ingester:
2774b6
   max_transfer_retries: 0
2774b6
   wal:
2774b6
     enabled: true
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     replay_memory_ceiling: 2500
2774b6
 ingester_client:
2774b6
   grpc_client_config:
2774b6
@@ -151,8 +151,8 @@ server:
2774b6
   log_level: info
2774b6
 storage_config:
2774b6
   boltdb_shipper:
2774b6
-    active_index_directory: /tmp/loki/index
2774b6
-    cache_location: /tmp/loki/index_cache
2774b6
+    active_index_directory: /var/lib/loki/index
2774b6
+    cache_location: /var/lib/loki/index_cache
2774b6
     cache_ttl: 24h
2774b6
     resync_interval: 5m
2774b6
     shared_store: s3
2774b6
@@ -207,12 +207,12 @@ overrides:
2774b6
 			FQDN: "loki-index-gateway-grpc-lokistack-dev.default.svc.cluster.local",
2774b6
 			Port: 9095,
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
@@ -253,7 +253,7 @@ common:
2774b6
       s3forcepathstyle: true
2774b6
 compactor:
2774b6
   compaction_interval: 2h
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
 frontend:
2774b6
   tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
2774b6
   compress_responses: true
2774b6
@@ -285,7 +285,7 @@ ingester:
2774b6
   max_transfer_retries: 0
2774b6
   wal:
2774b6
     enabled: true
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     replay_memory_ceiling: 2500
2774b6
 ingester_client:
2774b6
   grpc_client_config:
2774b6
@@ -376,8 +376,8 @@ server:
2774b6
   log_level: info
2774b6
 storage_config:
2774b6
   boltdb_shipper:
2774b6
-    active_index_directory: /tmp/loki/index
2774b6
-    cache_location: /tmp/loki/index_cache
2774b6
+    active_index_directory: /var/lib/loki/index
2774b6
+    cache_location: /var/lib/loki/index_cache
2774b6
     cache_ttl: 24h
2774b6
     resync_interval: 5m
2774b6
     shared_store: s3
2774b6
@@ -449,12 +449,12 @@ overrides:
2774b6
 			FQDN: "loki-index-gateway-grpc-lokistack-dev.default.svc.cluster.local",
2774b6
 			Port: 9095,
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
@@ -512,12 +512,12 @@ func TestBuild_ConfigAndRuntimeConfig_Cr
2774b6
 			FQDN: "loki-index-gateway-grpc-lokistack-dev.default.svc.cluster.local",
2774b6
 			Port: 9095,
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
@@ -557,7 +557,7 @@ common:
2774b6
       s3forcepathstyle: true
2774b6
 compactor:
2774b6
   compaction_interval: 2h
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
 frontend:
2774b6
   tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
2774b6
   compress_responses: true
2774b6
@@ -589,7 +589,7 @@ ingester:
2774b6
   max_transfer_retries: 0
2774b6
   wal:
2774b6
     enabled: true
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     replay_memory_ceiling: 2500
2774b6
 ingester_client:
2774b6
   grpc_client_config:
2774b6
@@ -709,15 +709,15 @@ ruler:
2774b6
         min_backoff: 30ms
2774b6
         max_backoff: 100ms
2774b6
   wal:
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     truncate_frequency: 60m
2774b6
     min_age: 5m
2774b6
     max_age: 4h
2774b6
-  rule_path: /tmp/loki
2774b6
+  rule_path: /var/lib/loki
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
-      directory: /tmp/rules
2774b6
+      directory: /var/lib/loki/rules
2774b6
   ring:
2774b6
     kvstore:
2774b6
       store: memberlist
2774b6
@@ -734,8 +734,8 @@ server:
2774b6
   log_level: info
2774b6
 storage_config:
2774b6
   boltdb_shipper:
2774b6
-    active_index_directory: /tmp/loki/index
2774b6
-    cache_location: /tmp/loki/index_cache
2774b6
+    active_index_directory: /var/lib/loki/index
2774b6
+    cache_location: /var/lib/loki/index_cache
2774b6
     cache_ttl: 24h
2774b6
     resync_interval: 5m
2774b6
     shared_store: s3
2774b6
@@ -792,7 +792,7 @@ overrides:
2774b6
 		},
2774b6
 		Ruler: Ruler{
2774b6
 			Enabled:               true,
2774b6
-			RulesStorageDirectory: "/tmp/rules",
2774b6
+			RulesStorageDirectory: "/var/lib/loki/rules",
2774b6
 			EvaluationInterval:    "1m",
2774b6
 			PollInterval:          "1m",
2774b6
 			AlertManager: &AlertManagerConfig{
2774b6
@@ -837,12 +837,12 @@ overrides:
2774b6
 				},
2774b6
 			},
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
@@ -883,7 +883,7 @@ common:
2774b6
       s3forcepathstyle: true
2774b6
 compactor:
2774b6
   compaction_interval: 2h
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
 frontend:
2774b6
   tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
2774b6
   compress_responses: true
2774b6
@@ -915,7 +915,7 @@ ingester:
2774b6
   max_transfer_retries: 0
2774b6
   wal:
2774b6
     enabled: true
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     replay_memory_ceiling: 2500
2774b6
 ingester_client:
2774b6
   grpc_client_config:
2774b6
@@ -1035,15 +1035,15 @@ ruler:
2774b6
         min_backoff: 30ms
2774b6
         max_backoff: 100ms
2774b6
   wal:
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     truncate_frequency: 60m
2774b6
     min_age: 5m
2774b6
     max_age: 4h
2774b6
-  rule_path: /tmp/loki
2774b6
+  rule_path: /var/lib/loki
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
-      directory: /tmp/rules
2774b6
+      directory: /var/lib/loki/rules
2774b6
   ring:
2774b6
     kvstore:
2774b6
       store: memberlist
2774b6
@@ -1060,8 +1060,8 @@ server:
2774b6
   log_level: info
2774b6
 storage_config:
2774b6
   boltdb_shipper:
2774b6
-    active_index_directory: /tmp/loki/index
2774b6
-    cache_location: /tmp/loki/index_cache
2774b6
+    active_index_directory: /var/lib/loki/index
2774b6
+    cache_location: /var/lib/loki/index_cache
2774b6
     cache_ttl: 24h
2774b6
     resync_interval: 5m
2774b6
     shared_store: s3
2774b6
@@ -1118,7 +1118,7 @@ overrides:
2774b6
 		},
2774b6
 		Ruler: Ruler{
2774b6
 			Enabled:               true,
2774b6
-			RulesStorageDirectory: "/tmp/rules",
2774b6
+			RulesStorageDirectory: "/var/lib/loki/rules",
2774b6
 			EvaluationInterval:    "1m",
2774b6
 			PollInterval:          "1m",
2774b6
 			AlertManager: &AlertManagerConfig{
2774b6
@@ -1164,12 +1164,12 @@ overrides:
2774b6
 				},
2774b6
 			},
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
@@ -1210,7 +1210,7 @@ common:
2774b6
       s3forcepathstyle: true
2774b6
 compactor:
2774b6
   compaction_interval: 2h
2774b6
-  working_directory: /tmp/loki/compactor
2774b6
+  working_directory: /var/lib/loki/compactor
2774b6
 frontend:
2774b6
   tail_proxy_url: http://loki-querier-http-lokistack-dev.default.svc.cluster.local:3100
2774b6
   compress_responses: true
2774b6
@@ -1242,7 +1242,7 @@ ingester:
2774b6
   max_transfer_retries: 0
2774b6
   wal:
2774b6
     enabled: true
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     replay_memory_ceiling: 2500
2774b6
 ingester_client:
2774b6
   grpc_client_config:
2774b6
@@ -1375,15 +1375,15 @@ ruler:
2774b6
         min_backoff: 30ms
2774b6
         max_backoff: 100ms
2774b6
   wal:
2774b6
-    dir: /tmp/wal
2774b6
+    dir: /var/lib/loki/wal
2774b6
     truncate_frequency: 60m
2774b6
     min_age: 5m
2774b6
     max_age: 4h
2774b6
-  rule_path: /tmp/loki
2774b6
+  rule_path: /var/lib/loki
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
-      directory: /tmp/rules
2774b6
+      directory: /var/lib/loki/rules
2774b6
   ring:
2774b6
     kvstore:
2774b6
       store: memberlist
2774b6
@@ -1400,8 +1400,8 @@ server:
2774b6
   log_level: info
2774b6
 storage_config:
2774b6
   boltdb_shipper:
2774b6
-    active_index_directory: /tmp/loki/index
2774b6
-    cache_location: /tmp/loki/index_cache
2774b6
+    active_index_directory: /var/lib/loki/index
2774b6
+    cache_location: /var/lib/loki/index_cache
2774b6
     cache_ttl: 24h
2774b6
     resync_interval: 5m
2774b6
     shared_store: s3
2774b6
@@ -1458,7 +1458,7 @@ overrides:
2774b6
 		},
2774b6
 		Ruler: Ruler{
2774b6
 			Enabled:               true,
2774b6
-			RulesStorageDirectory: "/tmp/rules",
2774b6
+			RulesStorageDirectory: "/var/lib/loki/rules",
2774b6
 			EvaluationInterval:    "1m",
2774b6
 			PollInterval:          "1m",
2774b6
 			AlertManager: &AlertManagerConfig{
2774b6
@@ -1521,12 +1521,12 @@ overrides:
2774b6
 				},
2774b6
 			},
2774b6
 		},
2774b6
-		StorageDirectory: "/tmp/loki",
2774b6
+		StorageDirectory: "/var/lib/loki",
2774b6
 		MaxConcurrent: MaxConcurrent{
2774b6
 			AvailableQuerierCPUCores: 2,
2774b6
 		},
2774b6
 		WriteAheadLog: WriteAheadLog{
2774b6
-			Directory:             "/tmp/wal",
2774b6
+			Directory:             "/var/lib/loki/wal",
2774b6
 			IngesterMemoryRequest: 5000,
2774b6
 		},
2774b6
 		ObjectStorage: storage.Options{
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/clients/pkg/promtail/promtail_test.go
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/clients/pkg/promtail/promtail_test.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/clients/pkg/promtail/promtail_test.go
2774b6
@@ -55,7 +55,7 @@ func TestPromtail(t *testing.T) {
2774b6
 	util_log.Logger = logger
2774b6
 
2774b6
 	initRandom()
2774b6
-	dirName := "/tmp/promtail_test_" + randName()
2774b6
+	dirName := "/var/lib/promtail_test_" + randName()
2774b6
 	positionsFileName := dirName + "/positions.yml"
2774b6
 
2774b6
 	err := os.MkdirAll(dirName, 0o750)
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/operator/docs/enhancements/ruler_support.md
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/operator/docs/enhancements/ruler_support.md
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/operator/docs/enhancements/ruler_support.md
2774b6
@@ -768,7 +768,7 @@ spec:
2774b6
         volumeMounts:
2774b6
         - name: "rules"
2774b6
           volume: "rules"
2774b6
-          path: "/tmp/rules"
2774b6
+          path: "/var/lib/loki/rules"
2774b6
       volumes:
2774b6
       - name: "rules"
2774b6
         items:
2774b6
@@ -785,7 +785,7 @@ spec:
2774b6
 In turn the rules directory is outlined as such:
a24c53
 
2774b6
 ```
2774b6
-/tmp/rules/application/ns-a-alerting-rule-a-kube-uid-a.yaml
2774b6
+/var/lib/loki/rules/application/ns-a-alerting-rule-a-kube-uid-a.yaml
2774b6
           /application/ns-a-recording-rule-a-kube-uid-b.yaml
2774b6
           /infrastructure/ns-b-alerting-rule-b-kube-uid-c.yaml
2774b6
           /infrastructure/ns-b-recording-rule-b-kube-uid-d.yaml
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/pkg/logcli/client/file_test.go
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/pkg/logcli/client/file_test.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/pkg/logcli/client/file_test.go
2774b6
@@ -20,8 +20,8 @@ func TestFileClient_QueryRangeLogQueries
2774b6
 	input := []string{
2774b6
 		`level=info event="loki started" caller=main.go ts=1625995076`,
2774b6
 		`level=info event="runtime loader started" caller=main.go ts=1625995077`,
2774b6
-		`level=error event="unable to read rules directory" file="/tmp/rules" caller=rules.go ts=1625995090`,
2774b6
-		`level=error event="failed to apply wal" error="/tmp/wal/ corrupted" caller=wal.go ts=1625996090`,
2774b6
+		`level=error event="unable to read rules directory" file="/var/lib/loki/rules" caller=rules.go ts=1625995090`,
2774b6
+		`level=error event="failed to apply wal" error="/var/lib/loki/wal/ corrupted" caller=wal.go ts=1625996090`,
2774b6
 		`level=info event="loki ready" caller=main.go ts=1625996095`,
2774b6
 	}
2774b6
 
2774b6
@@ -92,8 +92,8 @@ func TestFileClient_Query(t *testing.T)
2774b6
 	input := []string{
2774b6
 		`level=info event="loki started" caller=main.go ts=1625995076`,
2774b6
 		`level=info event="runtime loader started" caller=main.go ts=1625995077`,
2774b6
-		`level=error event="unable to read rules directory" file="/tmp/rules" caller=rules.go ts=1625995090`,
2774b6
-		`level=error event="failed to apply wal" error="/tmp/wal/ corrupted" caller=wal.go ts=1625996090`,
2774b6
+		`level=error event="unable to read rules directory" file="/var/lib/loki/rules" caller=rules.go ts=1625995090`,
2774b6
+		`level=error event="failed to apply wal" error="/var/lib/loki/wal/ corrupted" caller=wal.go ts=1625996090`,
2774b6
 		`level=info event="loki ready" caller=main.go ts=1625996095`,
2774b6
 	}
2774b6
 
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/pkg/loki/config_wrapper_test.go
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/pkg/loki/config_wrapper_test.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/pkg/loki/config_wrapper_test.go
2774b6
@@ -494,15 +494,15 @@ memberlist:
2774b6
 			fsConfig := `common:
2774b6
   storage:
2774b6
     filesystem:
2774b6
-      chunks_directory: /tmp/chunks
2774b6
-      rules_directory: /tmp/rules`
2774b6
+      chunks_directory: /var/lib/loki/chunks
2774b6
+      rules_directory: /var/lib/loki/rules`
a24c53
 
2774b6
 			config, defaults := testContext(fsConfig, nil)
2774b6
 
2774b6
 			assert.Equal(t, "local", config.Ruler.StoreConfig.Type)
2774b6
 
2774b6
-			assert.Equal(t, "/tmp/rules", config.Ruler.StoreConfig.Local.Directory)
2774b6
-			assert.Equal(t, "/tmp/chunks", config.StorageConfig.FSConfig.Directory)
2774b6
+			assert.Equal(t, "/var/lib/loki/rules", config.Ruler.StoreConfig.Local.Directory)
2774b6
+			assert.Equal(t, "/var/lib/loki/chunks", config.StorageConfig.FSConfig.Directory)
2774b6
 
2774b6
 			// should remain empty
2774b6
 			assert.EqualValues(t, defaults.Ruler.StoreConfig.GCS, config.Ruler.StoreConfig.GCS)
2774b6
@@ -662,8 +662,8 @@ storage_config:
2774b6
 					configString: `common:
2774b6
   storage:
2774b6
     filesystem:
2774b6
-      chunks_directory: /tmp/chunks
2774b6
-      rules_directory: /tmp/rules`,
2774b6
+      chunks_directory: /var/lib/loki/chunks
2774b6
+      rules_directory: /var/lib/loki/rules`,
2774b6
 					expected: config.StorageTypeFileSystem,
2774b6
 				},
2774b6
 			} {
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/pkg/loki/loki_test.go
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/pkg/loki/loki_test.go
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/pkg/loki/loki_test.go
2774b6
@@ -125,7 +125,7 @@ server:
2774b6
   http_listen_port: %d
2774b6
   grpc_listen_port: %d
2774b6
 common:
2774b6
-  path_prefix: /tmp/loki
2774b6
+  path_prefix: /var/lib/loki
2774b6
   ring:
2774b6
     kvstore:
2774b6
       store: inmemory
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/production/ksonnet/loki/config.libsonnet
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/production/ksonnet/loki/config.libsonnet
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/production/ksonnet/loki/config.libsonnet
2774b6
@@ -339,7 +339,7 @@
2774b6
       },
2774b6
 
2774b6
       ruler: if $._config.ruler_enabled then {
2774b6
-        rule_path: '/tmp/rules',
2774b6
+        rule_path: '/var/lib/loki/rules',
2774b6
         enable_api: true,
2774b6
         alertmanager_url: 'http://alertmanager.%s.svc.cluster.local/alertmanager' % $._config.namespace,
2774b6
         enable_sharding: true,
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki-distributed/config.yml
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/production/nomad/loki-distributed/config.yml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki-distributed/config.yml
2774b6
@@ -114,7 +114,7 @@ ruler:
2774b6
   enable_alertmanager_v2: true
2774b6
   enable_api: true
2774b6
   external_url: https://loki-ruler.service.consul
2774b6
-  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
2774b6
+  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki-simple/config.yml
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/production/nomad/loki-simple/config.yml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki-simple/config.yml
2774b6
@@ -66,7 +66,7 @@ ruler:
2774b6
   enable_alertmanager_v2: true
2774b6
   enable_api: true
2774b6
   external_url: https://loki.service.consul
2774b6
-  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
2774b6
+  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
2774b6
   storage:
2774b6
     type: local
2774b6
     local:
2774b6
Index: loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki/config.yml
2774b6
===================================================================
2774b6
--- loki-2.6.1+git.1658128747.6bd05c9a4.orig/production/nomad/loki/config.yml
2774b6
+++ loki-2.6.1+git.1658128747.6bd05c9a4/production/nomad/loki/config.yml
2774b6
@@ -66,7 +66,7 @@ ruler:
2774b6
   enable_alertmanager_v2: true
2774b6
   enable_api: true
2774b6
   external_url: https://loki.service.consul
2774b6
-  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/tmp/rules
2774b6
+  rule_path: {{ env "NOMAD_ALLOC_DIR" }}/var/lib/loki/rules
2774b6
   storage:
2774b6
     type: local
2774b6
     local: