“未找到的日志”在格拉法纳
我安装了Loki,Grafana和Promtail以及所有三个跑步。在http:// localhost:9080/准备就绪的目标是正确的,但是日志没有显示在grafana中,并在探索部分显示“未找到的logs”
Promtail-loctail-local-config-yaml:
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://localhost:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
host: ward_workstation
agent: promtail
__path__: D:/LOGs/*log
loki-loci-local-config.yaml:
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://localhost:9093
如何我可以解决这个问题吗?
I installed Loki, grafana and promtail and all three runing. on http://localhost:9080/targets Ready is True, but the logs are not displayed in Grafana and show in the explore section "No logs found"
promtail-local-config-yaml:
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://localhost:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
host: ward_workstation
agent: promtail
__path__: D:/LOGs/*log
loki-local-config.yaml:
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://localhost:9093
How can i solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您在Windows中使用Loki?
在您的Promtail Varlogs作业中,“ D:/logs/*log”路径显然是错误的,您无法直接从Docker访问Windows文件。
您会像这样将Windows文件安装到Docker上:
那么一切都会好起来的。
请注意,在您的Promtail Docker中,配置就是这样:

您可以调整两者以进行匹配...
Perhaps you are using Loki in Windows ?
In your promtail varlogs job ,the Path "D:/LOGs/*log" is obviously wrong, you cannot access the windows file from your docker directly.
You shoud mount your windows file to your docker like this:
Then everything will be ok.
Note that, in your promtail docker the config is like this:

you can adjust both to make a match...
这是根据问题的标题进行调试的一般建议:
(1)检查Promtail日志
如果发现
错误发送批处理
您需要修复 Promtail 配置。(2)打开 Promtail 配置页面并检查,如果 promtail 已读取您的给定配置:http:// localhost:3101/config
(3)打开 ProMTAIL 目标页面http:// localhost:3101/targets,并检查
对于发问者的具体问题:
发问者说,这些服务在目标页面中已准备就绪。因此,我建议检查(1)Promtail配置和(3B)访问日志文件(作为弗兰克)。
Here's a general advice how to debug Loki according to the question's title:
(1) Check promtail logs
If you discover such as
error sending batch
you need to fix your Promtail configuration.(2) Open the Promtail config page and check, if Promtail has read your given configuration: http://localhost:3101/config
(3) Open the Promtail targets page http://localhost:3101/targets and check
To the specific problem of the questioner:
The questioner said, that the services are shown as READY in the targets page. So I recommend to check (1) Promtail configuration and (3b) access to log files (as Frank).