Skip to content

Commit

Permalink
fix: TAT and adsb.one endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa authored Oct 22, 2023
2 parents 33c403e + 61bd93d commit db4e973
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 49 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
134 changes: 131 additions & 3 deletions grafana/dashboards/aggregators_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"content": "<div align=\"center\">\n <a href=\"https://github.com/rickstaa/adsb-dashboards\" target=\"_blank\"><img alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/rickstaa/adsb-dashboards?style=social\"></a>\n <a href=\"https://github.com/rickstaa/adsb-dashboards/fork\" target=\"_blank\"><img alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/rickstaa/adsb-dashboards?style=social\"></a>\n</div>",
"mode": "html"
},
"pluginVersion": "9.4.3",
"pluginVersion": "10.1.5",
"title": "Dashboard Info",
"type": "text"
},
Expand Down Expand Up @@ -86,6 +86,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -176,6 +253,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
Expand Down Expand Up @@ -263,6 +341,21 @@
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "airplanes.live"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
}
]
},
Expand Down Expand Up @@ -327,6 +420,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
Expand Down Expand Up @@ -492,6 +586,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
Expand Down Expand Up @@ -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"
}
}
]
}
]
},
Expand Down Expand Up @@ -607,7 +732,10 @@
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": ["ads-b", "aggregtors"],
"tags": [
"ads-b",
"aggregtors"
],
"templating": {
"list": []
},
Expand Down
23 changes: 14 additions & 9 deletions prometheus/exporters/json_exporter/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"
Expand All @@ -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 }"
Expand Down
42 changes: 21 additions & 21 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit db4e973

Please sign in to comment.