Skip to main content

Command Palette

Search for a command to run...

DevOps,Day - 75

Sending Docker Log to Grafana

Published
1 min readView as Markdown
DevOps,Day - 75
V

💻 Python | Docker | Jenkins | Networking | Git | Linux 💻


Passionate about leveraging technology to drive efficiency and deliver innovative solutions. Proficient in Python development, Docker containerization, Jenkins automation, computer networking, Git version control, and Linux administration. Skilled in collaborating with diverse teams to deliver high-quality software products. Proficient in AWS EC2 instance management and deployment.

Seeking new opportunities to apply my expertise and contribute to impactful projects. Let's connect and explore how we can work together!


Inter-personal Skills:

Communication, Adaptability, Emotional intelligence, Active listening, Collaboration.


Happy To Connect🔗😊

Feel free to reach me out😃@ --> vrishnishreevb531@gmail.com 📬


Hope you all have docker installed by this time : )

Now Download the Loki Config file into your current directory.

wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml

Run the Loki container

docker run -d --name loki -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.8.0 --config.file=/mnt/config/loki-config.yaml

Now download the Promtail Config yaml file.

wget https://raw.githubusercontent.com/grafana/loki/v2.8.0/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml

Now execute the Promtail container.

docker run -d --name promtail -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.8.0 --config.file=/mnt/config/promtail-config.yaml

Now type the docker ps command to see our running containers.

docker ps


Login to the Grafana Home Page

Add Loki as a data source

Paste this URL --> http://localhost:3100 --> Save and Test

Add Prometheus as a data source

Paste this URL --> http://localhost:9090 --> save and test.

Scroll up --> click on explore

Fill (Label Filters --> jobs, varlogs), (Line Contains -> docker) --> click on run query

And this is the output...

Now click on add to dashboard

click on open dashboard, and we can see our panel.


Thank you so much for reading

Follow me on LinkedIn to see interesting posts like this : )

Linkedin

S

Thank you for sharing your knowledge with us. It's really very helpful content for beginners. Keep posting such contents.

1
V

Sure😃, tqs for ur kind words Samara Reddy

More from this blog

Vrishni Blog

103 posts

Python | Docker | Jenkins | Networking | Git | Linux | AWS EC2 | Tech Enthusiast | Collaborative | Open to Opportunities | Email: vrishnishreevb531@gmail.com 📬