FlightAware Discussions

Fa-grafana - Dockerized Grafana Dashboards

Hey all,

We’ve been exploring some potential uses for Docker and Grafana recently.

For those of you unfamiliar with Docker, it is a useful tool that makes it easy to create and deploy applications in the form of “containers”. Think of a container as a pre-packaged, lightweight environment containing all the software and dependencies required for an application to run. No need to worry about the hassle of installing dependencies on your system.

Introducing…fa-grafana, a Dockerized environment that will run Grafana dashboards on top of existing PiAware installations.


Grafana has some cool dashboard and alert features that I think could be used to monitor and alert you about the aircraft you see and your Pi’s health. More to look into on that…For this initial version, fa-grafana just uses the dump1090-exporter dashboard with a few UI tweaks to display dump1090 metrics.

If you’d like to try it out, you can find setup instructions at https://github.com/flightaware/fa-grafana.

Let me know if you run into any issues. I’ve been running it on a Pi 3B+ but will need to do some more testing on different Pi models to see how it performs. (If ports 3000, 9090, or 9105 are in use on your Pi, you may see issues. Working out making them configurable)

8 Likes

Clean install on a non piaware image (Pi3B with buster). All commands complete successfully until the final command

ERROR: for grafana Cannot create container for service grafana: Conflict. The container name “/grafana” is already in use by container “7ae74f1f5a23d9b5781c67ae356edecd8357826704470f49b150c00cc4397423”. You have to remove (or rename) that container to be able to reuse that name.

ERROR: for grafana Cannot create container for service grafana: Conflict. The container name “/grafana” is already in use by container “7ae74f1f5a23d9b5781c67ae356edecd8357826704470f49b150c00cc4397423”. You have to remove (or rename) that container to be able to reuse that name.

@kevdel can you do a

sudo docker ps

and let me know what you see?

Installed it successfully on a Pi4. Looks nice, but right now is not really a time where looking at stats is much fun…

Agreed. Once airlines get back on their wings, we’ll hopefully have more interesting stats to look at :slight_smile:

I thought it was clean, I guess it wasn’t. Removed an old grafana docker image and now the install completes successfully!

thanks

2 Likes

I’ve run through the instructions (copied and pasted each one) but I am getting:

docker-compose: command not found.

I cant see any errors?


Reading package lists… Done
git installed. Proceeding…
pip3 installed. Proceeding…
Installing docker-compose…
Installing docker…

Adding pi user to docker group…
All necessary programs installed! Clone the fa-grafana directory and start up docker containers using docker-compose.

Any ideas?

So all the banefits of multiple apps reusing the standardized libraries (loaded in the memory) are gone?

Is that a typo, or did you say it’s a bane?

grafana is plagued by errors, putting it into a container so everyone is running the exact same software stack makes that easier to control.

2 Likes

Eric, Is there a way to make the dump1090-exporter pick up stats from a remote server?

I assume the IP in the env is for the grafana/prometheus host and changing that would screw things up

@Coooogz Hm maybe something went wrong with installing docker-compose. try a pip3 install docker-compose

@kevdel I have not tested that yet. dump1090-exporter fetches data from data/aircraft.json on host:8080 by default so as long as your host is running dump1090, it should be possible. I will check it out.

Installed without a hitch on Pi4, looks neat. I assume this will run automatically after a reboot as well?

ok. so i think i figured it out

edit the docker-compose.yml and change the

  "--url=http://${HOST_IP:?IP_ADDRESS_UNSET_ERROR}:8080",

to

  "--url=http://YOUR.REMOTE.IP:PORT",

e.g.

  "--url=http://192.168.1.11:80",

port 80 is the default and doesn’t really need to be specified

Once edited then rerun the command below to recreate the environments

sudo docker-compose up -d

@finchang I just commited a change to restart the prometheus and grafana containers if Docker is still running on a reboot. Stop the containers, git pull, and start them up again and they should run automatically after a reboot.

Inside the fa-grafana directory…

sudo docker-compose down
git pull
sudo docker-compose up -d

@kevdel It’s working ok with a remote host? Was your remote host a PiAware?

yes, the grafana/Prometheus/dump1090-exporter is on one machine with the dump1090-fa on another.

The dump1090-fa is not a piaware image, just rasbian with the dump1090-fa/piaware software bundle

1 Like

Good to know, thanks. I’ll make these port params configurable.

Thanks so much for making this! Installed and running successfully on a Pi4B with Buster.

2 Likes