Where to find working config for Loki?

Use Loki as driver in docker swarm
I took “complete-local-config.yaml” the config from the page with examples of config descriptions: Examples | Grafana Loki documentation, but it doesn’t work

level=info ts=2022-08-20T17:15:04.652695298Z caller=main.go:103 msg="Starting Loki" version="(version=2.6.1, branch=HEAD, revision=6bd05c9a4)"
level=info ts=2022-08-20T17:15:04.654208201Z caller=server.go:288 http=[::]:3100 grpc=[::]:9095 msg="server listening on addresses"
level=info ts=2022-08-20T17:15:04.655636043Z caller=modules.go:736 msg="RulerStorage is not configured in single binary mode and will not be started."
level=info ts=2022-08-20T17:15:04.661435238Z caller=modules.go:863 msg="Not using boltdb-shipper index, not starting compactor"
level=warn ts=2022-08-20T17:15:04.662758989Z caller=experimental.go:20 msg="experimental feature in use" feature="In-memory (FIFO) cache - chunksfifocache"
creating WAL folder at "/wal": mkdir wal: permission denied
error initialising module: ingester
github.com/grafana/dskit/modules.(*Manager).initModule
        /src/loki/vendor/github.com/grafana/dskit/modules/modules.go:122
github.com/grafana/dskit/modules.(*Manager).InitModuleServices
        /src/loki/vendor/github.com/grafana/dskit/modules/modules.go:92
github.com/grafana/loki/pkg/loki.(*Loki).Run
        /src/loki/pkg/loki/loki.go:341
main.main
        /src/loki/cmd/loki/main.go:105
runtime.main
        /usr/local/go/src/runtime/proc.go:255
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1581
level=error ts=2022-08-20T17:15:04.674104623Z caller=log.go:103 msg="error running loki" err="creating WAL folder at \"/wal\": mkdir wal: permission denied\nerror initialising module: ingester\ngithub.com/grafana/dskit/modules.(*Manager).initModule\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:122\ngithub.com/grafana/dskit/modules.(*Manager).InitModuleServices\n\t/src/loki/vendor/github.com/grafana/dskit/modules/modules.go:92\ngithub.com/grafana/loki/pkg/loki.(*Loki).Run\n\t/src/loki/pkg/loki/loki.go:341\nmain.main\n\t/src/loki/cmd/loki/main.go:105\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:255\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581"
 *  Terminal will be reused by tasks, press any key to close it.

where can I find a full working config for Loki for local data storage?

@budarin

Did you notice this part of the error?

 mkdir wal: permission denied

In what OS are you running this in? how did setup loki

noticed, but I do not know what to do - I am not a specialist in Loki (
both MacOs and Windows

1 Like

For windows try this approach, works on my pc :laughing:
basically I use the config from

https://raw.githubusercontent.com/grafana/loki/master/cmd/loki/loki-local-config.yamlconfig.yaml
1 Like

Not found (
but I mean Windows not as a host - I run everything in docker both on Windows & Mac

https://raw.githubusercontent.com/grafana/loki/master/cmd/loki/loki-local-config.yaml

I run it straight in windows without docker.

if you are having issues running it in docker, it is a docker issue not a grafana/loki issue.

line 22: field embedded_cache not found in type cache.Config

I am also confused by the name of the config -“loki-local-config.yaml” is it exactly for docker?

no that is the config for loki.

I recommend you read this and you wont be confused

there is an error in this configuration as reported by Loki in the logs

line 22: field embedded_cache not found in type cache.Config

1 Like

Comment out that portion

commented

# query_range:
#     results_cache:
#         cache:
#             embedded_cache:
#                 enabled: true
#                 distributed: false
#                 max_size_mb: 100

but Grafana is empty

but they are

I use a config from previous version with added ruler and frontend section added
It works but not stores data in local db - only in memory (

target: all
auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096

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

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

ruler:
  alertmanager_url: http://alertmanager:9093

frontend:
  address: 127.0.0.1

is there a way to add settings to persistent store data to the config?

Read the doc

All kind of storage

I’m new to this - I just wanted to use it by setting the default configuration, but it doesn’t work and reading the configs won’t help me much because I’ll need to study the whole product

Exactly. If you are going to use it and use it well nothing like reading the docu.

What exactly do you mean when you say it doesn’t work

with the config that you offered me, grafana does not see container logs, although they are there (with the old config it shows them but not store in db)

but with my configuration from the previous version, which does not save data to disk, logs are present

it would be great if the project had a folder with compose and a working config so that you could run it anywhere without external dependencies (only Loki Prometheus and Grafana) and without additional study of the documentation

is there any other documentation with a really working configuration for Loki for storing logs locally and displaying them in Grafana?

maybe this, otherwise cant help you, others might

Thanks!
I will try to run and test the config

your config is identical to mine see abowe

it has one problem - it does not save data on disk, but temporarily stores it in memory