diff --git a/README.md b/README.md index d7d2de4..b225212 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,27 @@ This repository contains several useful ADS-B Grafana dashboards. ## Content -- [aggregators_dashboard](grafana/dashboards/aggregators_dashboard.json): A dashboard that shows exciting statistics about several ADS-B aggregators. +- [aggregators_dashboard](grafana/dashboards/aggregators_dashboard.json): A dashboard that shows general statistics about several ADS-B aggregators. ## Instructions -This repository contains a [docker-compose](docker-compose.yml) file that can run the dashboards locally. You can use the following steps to do this: +This repository contains [docker-compose](docker-compose.yml) files that can be used to run the dashboards. You can use the following steps to do this: 1. Clone the repository. 2. Install [Docker](https://www.docker.com/). -3. Run `docker compose up -d` inside the repository folder;. +3. Run `docker compose up -d` inside the repository folder. 4. Checkout the dashboards at `localhost:3000`. ## Docker-compose components -The `docker-compose` file orchestrates three containers, each serving a distinct purpose: +The `docker-compose` file orchestrates ~~three~~two containers, each serving a distinct purpose: -- **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`. +**prometheus**: A [Prometheus](https://prometheus.io/) container for storing tracked data. Accessible on port `9090`. - **json_exporter**: A Prometheus [Json Exporter](https://github.com/prometheus-community/json_exporter) used for collecting API data. Accessible on port `7979`. -Moreover, within this repository, a [Portainer container](portainer/README.md) awaits, ready to facilitate the management of the other containers. +- ~~**adsbx_exporter**: A [custom ADSBx exporter](prometheus/exporters/adsbx_exporter/main.go) container dedicated to collecting adsbx API data. Accessible on port `19100`.~~ - No longer works due to recent [adsb-x](https://adsbexchange.com/) api changes. +- **Grafana**: A [Grafana](https://grafana.com/) container used for displaying tracked data. Accessible on port `3000`. + +Additionally, this repository contains a [Portainer container](portainer/README.md) that can be used to facilitate the management of the other containers. ## Contributing diff --git a/docker-compose.yml b/docker-compose.yml index dcf40b5..a9f9c10 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,14 +24,14 @@ services: ports: - 7979:7979 restart: unless-stopped - adsbx_exporter: - build: - context: ./prometheus/exporters/adsbx_exporter - dockerfile: Dockerfile - container_name: adsbx_exporter - ports: - - 19100:19100 - restart: unless-stopped + # adsbx_exporter: # NOTE: Disabled because adsbx protected their endpoint. + # build: + # context: ./prometheus/exporters/adsbx_exporter + # dockerfile: Dockerfile + # container_name: adsbx_exporter + # ports: + # - 19100:19100 + # restart: unless-stopped grafana: image: grafana/grafana:latest container_name: grafana diff --git a/grafana/dashboards/aggregators_dashboard.json b/grafana/dashboards/aggregators_dashboard.json index 951ac2d..1b01859 100644 --- a/grafana/dashboards/aggregators_dashboard.json +++ b/grafana/dashboards/aggregators_dashboard.json @@ -57,7 +57,7 @@ "content": "
\n \"GitHub\n \"GitHub\n
", "mode": "html" }, - "pluginVersion": "9.4.3", + "pluginVersion": "10.1.5", "title": "Dashboard Info", "type": "text" }, @@ -86,6 +86,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -113,7 +114,83 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "TAT" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "adsb-fi" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "adsb-lol" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "adsb-one" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "airplanes.live" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 9, @@ -176,6 +253,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -263,6 +341,21 @@ } } ] + }, + { + "matcher": { + "id": "byName", + "options": "airplanes.live" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] } ] }, @@ -327,6 +420,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -492,6 +586,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -564,6 +659,36 @@ } } ] + }, + { + "matcher": { + "id": "byName", + "options": "adsb-one" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "airplanes.live" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] } ] }, @@ -607,7 +732,10 @@ "revision": 1, "schemaVersion": 38, "style": "dark", - "tags": ["ads-b", "aggregtors"], + "tags": [ + "ads-b", + "aggregtors" + ], "templating": { "list": [] }, diff --git a/prometheus/exporters/json_exporter/config.yml b/prometheus/exporters/json_exporter/config.yml index 5ceddca..2b9573d 100644 --- a/prometheus/exporters/json_exporter/config.yml +++ b/prometheus/exporters/json_exporter/config.yml @@ -56,22 +56,27 @@ modules: path: "{ .global.planes }" labels: aggregator: adsb-lol - adsb-one-mlat: - metrics: + adsb-one: + metrics: - name: mlat_feeders help: ADS-B.one MLAT Feeder count. - path: "{ .client_count }" + path: "{ .mlat }" labels: aggregator: adsb-one - adsb-one-beast: - metrics: - name: beast_feeders help: ADS-B.one BEAST Feeder count. - path: "{ .clients }" + path: "{ .beast }" + labels: + aggregator: adsb-one + adsb-one-aircraft: + metrics: + - name: aircraft + help: ADS-B.one tracked aircraft count. + path: "{ .aircraft }" labels: aggregator: adsb-one TAT: - metrics: + metrics: - name: mlat_feeders help: TheAirTraffic.com MLAT Feeder count. path: "{ .mlat_clients }" @@ -83,14 +88,14 @@ modules: labels: aggregator: TAT airframes: - metrics: + metrics: - name: other_feeders help: Airframes.io MLAT Feeder count. path: "{ .stats.stations.active.total }" labels: aggregator: airframes airframes-aircraft: - metrics: + metrics: - name: aircraft help: Airframes.io tracked aircraft count. path: "{ .stats.airframes.flights.active }" diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index 1135306..f052cae 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -111,15 +111,15 @@ scrape_configs: target_label: instance - target_label: __address__ replacement: json_exporter:7979 - - job_name: adsb_one_mlat_exporter + - job_name: adsb_one_exporter scrape_interval: 15m scrape_timeout: 30s metrics_path: /probe params: - module: ["adsb-one-mlat"] + module: ["adsb-one"] static_configs: - targets: - - https://api.adsb.one/clients/mlat + - https://api.adsb.one/stats relabel_configs: - source_labels: [__address__] target_label: __param_target @@ -129,15 +129,15 @@ scrape_configs: target_label: instance - target_label: __address__ replacement: json_exporter:7979 - - job_name: adsb_one_beast_exporter - scrape_interval: 15m + - job_name: adsb_one_aircraft_exporter + scrape_interval: 5m scrape_timeout: 30s metrics_path: /probe params: - module: ["adsb-one-beast"] + module: ["adsb-one-aircraft"] static_configs: - targets: - - https://api.adsb.one/clients/beast + - https://api.adsb.one/stats relabel_configs: - source_labels: [__address__] target_label: __param_target @@ -155,7 +155,7 @@ scrape_configs: module: ["TAT"] static_configs: - targets: - - https://theairtraffic.com/api/stats.json/ + - https://theairtraffic.com/iapi/stats.json/ relabel_configs: - source_labels: [__address__] target_label: __param_target @@ -201,19 +201,19 @@ scrape_configs: target_label: instance - target_label: __address__ replacement: json_exporter:7979 - - job_name: adsbx_exporter - scrape_interval: 15m - scrape_timeout: 30s - static_configs: - - targets: - - http://adsbx_exporter:19100 - relabel_configs: - - source_labels: [__address__] - target_label: __param_target - - source_labels: [__param_target] - target_label: instance - - target_label: __address__ - replacement: adsbx_exporter:19100 + # - job_name: adsbx_exporter # NOTE: Disabled because adsbx protected their endpoint. + # scrape_interval: 30s + # scrape_timeout: 30s + # static_configs: + # - targets: + # - http://adsbx_exporter:19100 + # relabel_configs: + # - source_labels: [__address__] + # target_label: __param_target + # - source_labels: [__param_target] + # target_label: instance + # - target_label: __address__ + # replacement: adsbx_exporter:19100 # Uncomment if you want to send data to grafana cloud # remote_write: