This repository contains scenarios that demonstrate how to use Grafana Alloy to monitor various data sources. Each scenario is a self-contained example which will include an LGMT
stack (Loki, Grafana, Metrics, Tempo) and an Alloy configuration file.
You can run any scenario in two ways:
- Traditional way: Navigate to the scenario directory and run
docker compose up -d
- Using centralized image management: Run
./run-example.sh <scenario-directory>
from the root directory
The centralized approach allows you to manage all Docker image versions in a single image-versions.env
file, making it easier to update images across all examples.
Scenario | Description |
---|---|
Docker Monitoring | Monitor Docker containers using Grafana Alloy. |
Syslog | Monitor non RFC5424 compliant syslog messages using rsyslog and Alloy. |
Logs Over TCP | Send TCP logs to Alloy within a JSON format. |
Mail House | Learn how to parse structured logs into Labels and Structured Metadata |
Monitor Windows | Learn how to use Grafana Alloy to monitor system metrics and Event Logs |
Monitor Linux | Learn how to use Grafana Alloy to monitor a Linux Server |
Kubernetes | A series of scenarios that demonstrate how to setup Alloy via the Kubernetes monitoring helm chart. Examples specific to each telemetry source are provided in the respective directories. |
Logs from File | Monitor logs from a file using Grafana Alloy. |
OpenTelemetry Basic Tracing | Collect and visualize OpenTelemetry traces using Grafana Alloy and Tempo. |
OpenTelemetry Tracing Service Graph Generation | Learn how to generate service graphs from OpenTelemetry traces using Grafana Alloy and Tempo. |
OpenTelemetry Tail sampling | Learn how to use OpenTelemetry tail sampling with Grafana Alloy and Tempo. |
Trace Deliverty | A fun scenerio where the concepts of traces are taught through the supply chain of sofa creaton |
Game of Tracing | Learn traces through a strategic game |
Kafka | Learn how to use Grafana Alloy to monitor logs from Kafka. |
Popular Logging Frameworks | Learn how to use Grafana Alloy to parse logs from popular logging frameworks. |
We welcome contributions of new scenarios or improvements to existing ones! You can contribute in several ways:
If you have an idea for a scenario but don't have time to implement it:
- Open a new issue with the label
scenario-suggestion
- Describe the scenario and what it would demonstrate
- Explain why this would be valuable to the community
- Outline any special requirements or considerations
If you'd like to contribute a complete scenario:
- Fork this repository and create a new branch
- Create a new directory in the root of this repository with a descriptive name for your scenario
- Follow the scenario template below
- Submit a pull request with your new scenario
To improve an existing scenario:
- Fork this repository and create a new branch
- Make your improvements to the existing scenario
- Submit a pull request with a clear description of your changes
When creating a new scenario, please include the following files:
docker-compose.yml
- Docker Compose file with the LGMT stackconfig.alloy
- Alloy configuration file for the scenarioREADME.md
- Documentation explaining the scenario- Any additional files needed for your scenario (scripts, data files, etc.)
You can use the .cursor/docker-example.mdc
file as a template for new Docker-based scenarios.
Before submitting your scenario, please ensure:
- Created a new directory in the root of this repository with a descriptive name
- Included a docker-compose.yml file with the necessary components (LGMT stack or subset)
- Created a complete config.alloy file that demonstrates the monitoring approach
- Written a README.md with:
- A clear description of what the scenario demonstrates
- Prerequisites for running the demo
- Step-by-step instructions for running the demo
- Expected output and what to look for
- Screenshots (if applicable)
- Explanation of key configuration elements
- Added the scenario to the table in this README.md
- Ensured the scenario works with the centralized image management system
- Verified all components start correctly with
docker compose up -d
- Keep the scenario focused on demonstrating one concept
- Use clear, descriptive component and variable names
- Add comments to explain complex parts of your Alloy configuration
- Consider including a "Customizing" section in your README.md
- Provide sample queries for Grafana/Prometheus/Loki/Tempo that work with your scenario
- Use environment variables for versions and configurable parameters
If you have questions about creating a scenario or need help with Alloy:
- Join the Grafana Labs Community Forums
- Check the Grafana Alloy documentation
This repository is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.