05-30-2024 01:10 PM
hi ,
I am trying to monitor all the nso logs in my Grafana Loki dashboard using nso Observability-exporter package. I have loaded the observability-exporter package successfully in my nso. When I run the setup.sh which is inside bservability-exporter package, I get 7 different container created. Those containers are 1. observability-exporter-jaeger, 2. observability-exporter-jaeger-collector, 3. observability-exporter-elasticsearch, 4. observability-exporter-influxdb, 5. observability-exporter-grafana, 6. observability-exporter-prometheus, 7. observability-exporter-otelcol.
Now my goal is to create a loki container and integrate that with Grafana dashboard so that I should be able to see all the logs in my Grafana Dashboard. How to achieve this please suggest.
Thanks
05-31-2024 06:00 AM
You can use the official Loki Docker image to create a Loki container. I found an example so here is how to command to create a Loki container named observability-exporter-loki
you will need to do this to create a Docker volume loki-volume
to store the Loki data, and a network observability-exporter-net
to allow communication between the containers fyi.
docker run -d --name observability-exporter-loki --volume=loki-volume:/mnt/loki --network=observability-exporter-net grafana/loki:2.4.0 --config.file=/mnt/loki/local-config.yaml
You will also need to create a local-config.yaml
file to configure Loki. Here's an example configuration, i found on their website
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9095
log_level: info
chunk_target_size: 1048576
table_manager:
retention_deletes_enabled: false
retention_period: 168h
retention_target_size: 10485760
chunk_idle_period: 5m
retention_recheck_interval: 1h
retention_soft_deletes_enabled: false
retention_soft_delete_period: 24h
retention_compaction_window: 168h
retention_compaction_retries: 3
retention_compaction_retry_delay: 1m
retention_compaction_max_series_per_chunk: 1000
retention_compaction_max_age: 168h
retention_compaction_min_size: 1048576
retention_compaction_schedule: "0 0 * * *"
retention_compaction_working_set: 1000000000
retention_compaction_index_cache_size: 100000000
retention_compaction_index_cache_ttl: 1h
retention_compaction_index_cache_max_age: 1h
retention_compaction_index_cache_max_entries: 1000000
retention_compaction_index_cache_max_entry_size: 10000
retention_compaction_index_cache_max_entry_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_age: 1h
retention_compaction_index_cache_max_entry_ttl_size: 10000
retention_compaction_index_cache_max_entry_ttl_size_age: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl_ttl_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl_ttl_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl_ttl_ttl: 1h
retention_compaction_index_cache_max_entry_ttl_size_age_ttl_ttl_ttl_ttl: 1h
retention_compaction_index_cache_max
06-03-2024 04:42 AM
I used the above local-config.yaml bit that throws error and container is exiting. We must use a proper local-config.yaml file.
06-03-2024 06:27 AM
Ok try rthis version, also create a volume for the loki data and update the store section accordingly, then also, create an overrides.yaml file to configure runtime overrides if you need.
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9095
log_level: info
ingester:
lifecycler:
ring:
kvstore:
store: inmemory
chunk_idle_period: 5m
chunk_target_size: 1048576
max_chunk_age: 2h
store:
boltdb:
path: /mnt/loki/index
schema_config:
configs:
- from: 2020-05-15
store: boltdb
object_store: file
schema: v11
index:
period: 24h
prefix: index_
limits_config:
ingestion_rate_mb: 10
ingestion_burst_size_mb: 20
runtime_config:
file: overrides.yaml
06-03-2024 01:17 PM
06-04-2024 12:07 AM
06-04-2024 12:58 AM
06-04-2024 04:38 AM
06-05-2024 12:15 AM
I am not able to access loki UI. I exposed 3100 as 50109 but not able to access the UI. please suggest whats wrong i am doing. The goal is I should be able to see Label filters option in the grafana dashboard and should be able to pass queries.
Attaching Screenshots for better clarity.
06-05-2024 04:04 AM
To troubleshoot the inaccessible Loki UI, begin by examining the container logs with docker logs -f observability-exporter-loki
for error messages. Next, confirm that the port mapping in your docker-compose
file or docker run
command correctly exposes port 3100 and maps it to port 50109 on the host. Then, inspect the Loki configuration file (local-config.yaml
) to ensure it points to the appropriate storage backend (like Elasticsearch). Finally, verify that the Loki container shares the same network as other containers (such as Grafana, Elasticsearch) and that the network configuration is accurate.
Hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide