grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.17k stars 3.36k forks source link

COnfiguring fluentbit with Loki Chart #13047

Open dk03051996 opened 2 months ago

dk03051996 commented 2 months ago

Hi, I am trying to configure fluentbit that comes with GKE with loki official helm chart. I am unable to push logs to loki. I am using below configmap to push logs to loki. apiVersion: v1 kind: ConfigMap metadata: name: fluent-bit-config namespace: kube-system data: fluent-bit.conf: | [SERVICE] flush 1 log_level info [INPUT] name tail path /etc/data/data.log tag log_generator [OUTPUT] Name stdout Match * [OUTPUT]

for sending logs to local Loki instance

   name        loki
   match       *
   host        loki-gateway.monitoring
   port        80
   labels      job=fluentbit, $sub['stream']

I have added below lines to refer configmap and volume mounts.

"I can also see below error in loki-gateway, don't know if it is related to fluentbit or something else "2024/05/28 10:01:20 [error] 9#9: *1025253 readv() failed (104: Connection reset by peer) while reading upstream, client: 10.180.4.23, server: , request: "POST /loki/api/v1/push HTTP/1.1", upstream: "http://10.184.7.132:3100/loki/api/v1/push", host: "loki-gateway.monitoring.svc.cluster.local"

JStickler commented 2 months ago

Questions have a better chance of being answered if you ask them on the community forums.

jade-tseng commented 1 month ago

host to Loki-write svc instead of loki-gateway worked for me