Log Monitoring Using Grafan Loki

— 1 minute read

In this ar­ti­cle, we will cover how to mon­i­tor log us­ing Grafana and Loki.

  • in the past, when i got an er­ror, i had to SSH to the server and check the log
  • but, it’s not easy to query the er­ror
  • so, i’m look­ing for a way to mon­i­tor the logs
  • in my ex­pe­ri­ence you can use ELK stack or Sentry to mon­i­tor the log
  • but from my case, where i have lim­ited re­sources, those op­tions are not vi­able.
  • and then i found the Loki pro­jects from Grafana teams.
  • it writ­ten in Go, so i ex­pect low re­source us­ages
  • and it query abi­il­ity us­ing LogQL
  • i try in lo­cal, and these are the tools we need
    • grafana
      • dash­board for loki
    • loki
      • the log proces­sor
    • prom­tail
      • to col­lect & for­ward log from ser­vices to Loki