Skip to content

Commit

Permalink
feat: add airplanes.live
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa authored Oct 22, 2023
2 parents af0d53a + 8a2eb66 commit 33c403e
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 16 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ This repository contains a [docker-compose](docker-compose.yml) file that can ru

## Docker-compose components

The `docker-compose` file spins up four containers:
The `docker-compose` file orchestrates three containers, each serving a distinct purpose:

- **Portainer**: A container that runs [Portainer](https://www.portainer.io/install) which can be used to manage the other containers (port `9443`).
- **Prometheus**: A container that runs [Prometheus](https://prometheus.io/) (port `9090`).
- **json_exporter**: A container that runs a Prometheus [Json Exporter](https://github.com/prometheus-community/json_exporter) (port `7979`).
- **adsbx_exporter**: A container that runs a [custom ADSBx exporter](prometheus/exporters/adsbx_exporter/main.go) (port `19100`).
- **Grafana**: A container runs [Grafana](https://grafana.com/) (port `3000`).
- **json_exporter**: Here resides a container running a Prometheus [Json Exporter](https://github.com/prometheus-community/json_exporter) accessible on port `7979`.
- **adsbx_exporter**: This container is dedicated to executing a [custom ADSBx exporter](prometheus/exporters/adsbx_exporter/main.go) and exposes its metrics on port `19100`.
- **Grafana**: Hosting [Grafana](https://grafana.com/), this container makes its services available on port `3000`.

Moreover, within this repository, a [Portainer container](portainer/README.md) awaits, ready to facilitate the management of the other containers.

## Contributing

Expand Down
10 changes: 0 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
version: "3.8"

services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
volumes:
- portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9443:9443
- 8000:8000
restart: unless-stopped
prometheus:
image: quay.io/prometheus/prometheus
container_name: prometheus
Expand Down
7 changes: 7 additions & 0 deletions portainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Portainer

[Portainer's](https://www.portainer.io/) hybrid & multi-cloud container management software supports Kubernetes, Docker, Swarm in any Data Center, Cloud, Network Edge or IoT Device.

## Installation

First, install [Docker](https://docs.docker.com/get-docker/). Following, build and start the AdGuardHome container using the `docker compose up -d` command.
20 changes: 20 additions & 0 deletions portainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.8"

services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
volumes:
- portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9443:9443
- 8000:8000
restart: unless-stopped

volumes:
portainer_data:

networks:
default:
name: portainer
19 changes: 19 additions & 0 deletions prometheus/exporters/json_exporter/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ modules:
path: "{ .totalAircraft }"
labels:
aggregator: adsb-fi
airplanes-live:
metrics:
- name: beast_feeders
help: airplanes.live beast feeder count
path: "{ .beast }"
labels:
aggregator: airplanes.live
- name: mlat_feeders
help: airplanes.live mlat feeder count
path: "{ .mlat }"
labels:
aggregator: airplanes.live
airplanes-live-aircraft:
metrics:
- name: aircraft
help: airplanes.live tracked aircraft count
path: "{ .aircraft }"
labels:
aggregator: airplanes.live
adsb-lol:
metrics:
- name: mlat_feeders
Expand Down
36 changes: 36 additions & 0 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,42 @@ scrape_configs:
target_label: instance
- target_label: __address__
replacement: json_exporter:7979
- job_name: airplanes_live_exporter
scrape_interval: 15m
scrape_timeout: 30s
metrics_path: /probe
params:
module: ["airplanes-live"]
static_configs:
- targets:
- https://api.airplanes.live/stats
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [module]
target_label: __param_module
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: json_exporter:7979
- job_name: airplanes_live_aircraft_exporter
scrape_interval: 5m
scrape_timeout: 30s
metrics_path: /probe
params:
module: ["airplanes-live-aircraft"]
static_configs:
- targets:
- https://api.airplanes.live/stats
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [module]
target_label: __param_module
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: json_exporter:7979
- job_name: adsb_lol_exporter
scrape_interval: 15m
scrape_timeout: 30s
Expand Down

0 comments on commit 33c403e

Please sign in to comment.