Hello,
I am using Loki version 3.4.2
and I want to create a new Data sources, but I get the error Unable to connect with Loki. Please check the server logs for more details.
Loki configuration is as follows:
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: debug
grpc_server_max_concurrent_streams: 1000
common:
instance_addr: 172.20.1.29
path_prefix: /var/lib/loki
storage:
filesystem:
chunks_directory: /var/lib/loki/chunks
rules_directory: /var/lib/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100
limits_config:
metric_aggregation_enabled: true
schema_config:
configs:
- from: 2020-10-24
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://localhost:9093
frontend:
encoding: protobuf
And Loki is running properly on the server:
# ss -tupln
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
tcp LISTEN 0 4096 *:3000 *:* users:(("grafana",pid=319190,fd=10))
tcp LISTEN 0 4096 *:3100 *:* users:(("loki",pid=319171,fd=7))
And:
# curl http://localhost:3100/ring
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ring Status</title>
</head>
<body>
<h1>Ring Status</h1>
<p>Current time: 2025-03-08 02:02:26.632523562 -0800 PST m=+339.574164195</p>
<form action="" method="POST">
<input type="hidden" name="csrf_token" value="$__CSRF_TOKEN_PLACEHOLDER__">
<table width="100%" border="1">
<thead>
<tr>
<th>Instance ID</th>
<th>Availability Zone</th>
<th>State</th>
<th>Address</th>
<th>Registered At</th>
<th>Read-Only</th>
<th>Read-Only Updated</th>
<th>Last Heartbeat</th>
<th>Tokens</th>
<th>Ownership</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Grafana</td>
<td></td>
<td>ACTIVE</td>
<td>172.20.1.29:9096</td>
<td>2025-03-08T09:56:47Z</td>
<td></td>
<td></td>
<td>9s ago (10:02:17)</td>
<td>128</td>
<td>100%</td>
<td>
<button name="forget" value="Grafana" type="submit">Forget</button>
</td>
</tr>
</tbody>
</table>
<br>
<input type="button" value="Show Tokens" onclick="window.location.href = '?tokens=true'"/>
</form>
</body>
</html>
How do I fix this problem?
Thank you.