Skip to content

grafana/loki-fundamentals

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Loki Quickstart

This repository provides a quickstart guide to running Grafana Loki locally using Docker Compose. This setup includes Grafana, Loki, and Grafana Alloy for log collection and visualization.

Loki Stack

Getting Started

📖 Loki Quickstart Documentation

Prerequisites

Ensure you have the following installed on your system:

Running the Loki Stack

  1. Clone this repository:
    git clone https://github.com/grafana/loki-fundamentals.git -b getting-started
  2. Navigate into the repository:
    cd loki-fundamentals
  3. Start Loki, Grafana, and Alloy using Docker Compose:
    docker compose up -d
  4. Verify the components are running:

Deploying the Sample Application

Sample Microservice Architecture

To test log collection, deploy the Carnivorous Greenhouse application:

  docker compose -f greenhouse/docker-compose-micro.yml up -d --build

You can then interact with the sample app at http://localhost:5005 to generate logs.

Querying Logs

You can query logs using Grafana’s Explore feature at http://localhost:3000:

  1. Open Explore.
  2. Select the Loki data source.
  3. Use LogQL queries, e.g.,:
    {container="greenhouse-main_app-1"} |= "ERROR"
    

For more advanced queries and troubleshooting, refer to the full documentation.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (feature-branch-name).
  3. Commit your changes.
  4. Open a pull request.

Issues

If you encounter any problems, please open an issue in this repository with:

  • A clear description of the problem.
  • Steps to reproduce the issue.
  • Logs or error messages if available.

About

Tutorial repository for Loki fundamentals

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.7%
  • HTML 44.8%
  • CSS 6.5%