Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone docker-compose install #54

Open
mwolter805 opened this issue Sep 11, 2021 · 3 comments
Open

Standalone docker-compose install #54

mwolter805 opened this issue Sep 11, 2021 · 3 comments
Labels
no-stale This issue or PR is exempted from the stable bot.

Comments

@mwolter805
Copy link

mwolter805 commented Sep 11, 2021

@mdegat01 Thanks for creating this container and filling the void left by Grafana.

Thought I'd share how to use this container on a standalone docker install in case others use Home Assistant Container. This uses /ready to perform a healthcheck and also passes through the host name of the docker host for use in the config. This has been tested on a Pi 4 running rasbian 10 buster.

Create the promtail folder:
mkdir -p ~/promtail && cd ~/promtail

Change the following in promtail.yaml

  • clients: url to the IP of the machine running Loki

Save the files below in the ~/promtail folder made above and remove the .txt extensions.
run_promtail.sh.txt
docker-compose.yaml.txt
promtail.yaml.txt

Make sure run_promtail.sh is executable
sudo chmod a+x ~/promtail/run_promtail.sh

Create the container
sudo docker-compose up -d

Verify metrics
wget -qO- http://localhost:9080/metrics

Verify readiness
wget -qO- http://localhost:9080/ready

@mdegat01
Copy link
Owner

Thanks! Yea I was surprised they did not publish a container that came pre-made with a binary capable of reading from the journal. I mostly made this so my PRs stopped taking forever in the promtail addon repo due to making the binary every time but great that its also able to be used standalone.

I can take a look at this and update the doc to include this usage option. Although before I do, one quick question, is there an advantage to doing this in a Container install over using their docker driver? When I was reading through the Grafana's documentation it seemed like they were pushing people to use their docker driver in docker setups instead of trying to use promtail to read the docker logs. That's not an option in the supervised install because using journal logging is a requirement (and also because I tried and it broke everything 😄). I had thought that people doing a container install would be able to go that route though.

I ask because that is what I had posted on this community guide for setting up the PLG stack in a container install. If that's wrong though and this way is better I will gladly update the doc here and link to it back there.

@mwolter805
Copy link
Author

mwolter805 commented Sep 13, 2021

Hi,
Yep, you're right, for docker logs it's best to use the docker driver. What I'm using this for is to forward the systemd Journal logs and syslogs from a Raspberry Pi. Grafana's promtail only forwards syslogs for arm machines and not journal logs, that's where your's fills the gap. Their amd64 promtail does journal and syslogs, not their arm install.

Grafana's docker driver is used to forward console logs from docker containers. It doesn't do journal or syslogs. So you need promtail and the docker driver if you want everything. And you need your promtail instead of theirs if you want everything from an arm machine.

Systemd journal logs might be overkill for most users, but I have an issue where the Pi is locking up every week or so and I'm trying to forward all logs for troubleshooting. Hopefully, this will give me some indication as to what's going on.

Hopefully this helps clear it up. Thanks again!

@github-actions
Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Nov 17, 2021
@mdegat01 mdegat01 added no-stale This issue or PR is exempted from the stable bot. and removed stale There has not been activity on this issue or PR for quite some time. labels Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale This issue or PR is exempted from the stable bot.
Projects
None yet
Development

No branches or pull requests

2 participants