- Introduction
- Features
- Getting Started
- Generate Self-Signed SSL Certificate
- Usage
- Monitoring Container Logs
- Contributing
- License
This project provides a containerized version of Grafana, an open-source platform for monitoring and observability. It's designed to be easy to deploy and manage, making it ideal for environments that benefit from containerization. The Grafana Container offers a scalable way to visualize and analyze metrics, logs, and traces from your environment.
- Easy to deploy Grafana in a containerized environment.
- Configurable settings for different monitoring needs.
- Integration with various data sources.
- Docker and Docker Compose installed on your system.
- Basic understanding of containerization and Grafana.
- Clone the repository:
git clone https://github.com/benjisho/grafana-container.git
- Navigate to the cloned directory:
cd grafana-container
Note: This section is relevant if you haven't generated a well-known SSL certificate from a certified authority. These will guide you on creating a self-signed certificate, useful for testing or development purposes.
- Run the following command to generate a 2048-bit RSA private key, which is used to decrypt traffic:
openssl genrsa -out certs/server.key 2048
- Run the following command to generate a certificate, using the private key from the previous step.
openssl req -new -key certs/server.key -out certs/server.csr
- Run the following command to self-sign the certificate with the private key, for a period of validity of 365 days:
openssl x509 -req -days 365 -in certs/server.csr -signkey certs/server.key -out certs/server.crt
To use the Grafana Container:
- Start the container:
docker-compose up -d
- Access Grafana by navigating to
https://localhost
in your web browser. - Default login user is usually
admin
for both username and password (unless configured otherwise). - Configure data sources and dashboards as per your requirements.
For example, to add a Prometheus data source:
- Navigate to
Configuration > Data Sources
in the Grafana UI.- Click
Add data source
, and selectPrometheus
.- Enter the URL of your Prometheus server, and click
Save & Test
.
- Explore and create dashboards to visualize your data. For more detailed usage instructions, refer to the Grafana documentation.
This section guides you on how to use docker-compose logs -f
to follow the log output of the Grafana and Nginx containers in real-time.
docker-compose logs -f
: This command fetches the logs of the containers.- The
-f
flag means "follow", allowing you to view the log output in real-time.
-
Navigate to where your
docker-compose.yml
file is located. -
Execute the following command to follow the logs for all services:
docker-compose logs -f
This will display a continuous stream of logs of all containers in the
docker-compose.yml
. -
If you want to follow the logs of a specific container from the
docker-compose.yml
, specify the service name. For example, to follow only the Grafana logs, use:docker-compose logs -f grafana
Similarly, for Nginx logs:
docker-compose logs -f nginx
- Grafana Logs: Look for indications of successful startup, connection to data sources, and any error messages related to querying data.
- Nginx Logs: These logs will include information about HTTP requests, responses, and any errors related to network connections or SSL/TLS certificates.
Note: Keep in mind that the volume of logs can be high depending on the level of activity. It's advisable to filter or search through the logs for specific keywords related to the issues you're investigating.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details.