Skip to content

Commit e988a89

Browse files
authored
Release v1.0.4 (#2)
* Dashboard updates: Add collector const label to dashboard. Add possibility to add other const labels. Dashboard updates: Add country to dashboard. Trying to detect false positive airline detections Add country icao codes to countries.csv Detect country of hex, added label to info metric. add wikipedia reference, bump version to 1.0.4, introduce countries.csv. * Update readme, add missing license-header
1 parent c67a203 commit e988a89

21 files changed

Lines changed: 1533 additions & 950 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
release
55
dump1090prom
6+
docs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SHELL := /bin/bash
1919

2020
GO := GO111MODULE=on go
2121
GO_PATH = $(shell $(GO) env GOPATH)
22-
APP_VERSION_DOT = "1.0.3"
22+
APP_VERSION_DOT = "1.0.4"
2323

2424
.PHONY: all
2525
all: help

README.md

Lines changed: 45 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Dump1090Prom – Aircraft data exporter for Prometheus
22

33
A Prometheus exporter for `readsb`/`dump1090` aircraft data.
4-
This exporter converts dump1090 data into [prometheus](https://prometheus.io/) metrics, allowing to monitor and visualizing collected aircraft data in detail.
5-
This repository contains a [Grafana dashboard](dashboards/dump1090prom-grafana-dashboard.json) for visualizing the collected data.
4+
This exporter converts dump1090 data into [Prometheus](https://prometheus.io/) metrics, allowing you to monitor and visualize collected aircraft data in detail.
5+
The repository includes a [Grafana dashboard](dashboards/dump1090prom-grafana-dashboard.json) for visualizing the metrics.
66

77
Tested with:
88
- [flightaware/dump1090](https://github.com/flightaware/dump1090)
99
- [wiedehopf/readsb](https://github.com/wiedehopf/readsb)
1010

11-
Version: 1.0.3
11+
Version: 1.0.4
1212

1313
## Features
1414

15-
- Exports aircraft data as Prometheus metrics for each aircraft
16-
- Supports multiple data sources via a base path:
17-
- Local directory containing `aircraft.json` and `receiver.json`
18-
- HTTP/HTTPS base URL exposing `aircraft.json` and `receiver.json`
19-
- Enriches aircraft data with airline information (embedded from Wikipedia data)
20-
- Calculates distance between receiver and aircraft when the receiver position is known (from receiver.json or -lat/-lon override)
21-
- Includes a ready-to-use Grafana dashboard
15+
- Exports aircraft data as Prometheus metrics.
16+
- Supports multiple data sources:
17+
- Local directory containing `aircraft.json` and `receiver.json`.
18+
- HTTP/HTTPS base URL exposing `aircraft.json` and `receiver.json`.
19+
- Enriches aircraft data with airline information (embedded from Wikipedia).
20+
- Calculates the distance between the receiver and aircraft when the receiver position is known (from `receiver.json` or `-lat`/`-lon` override).
21+
- Includes a ready-to-use Grafana dashboard.
2222

2323
## Installation
2424

2525
### Prerequisites
2626

27-
- *readsb* or *dump1090* with *rtlsdr* or compatible software generating `aircraft.json` and `receiver.json`
27+
- `readsb` or `dump1090` (with `rtlsdr` or compatible hardware) generating `aircraft.json` and `receiver.json`.
2828

2929
### Option 1: Download a release file
3030

@@ -46,7 +46,7 @@ go build
4646

4747
### Running permanently (Linux)
4848

49-
If you use Linux, you can use [this systemd unit file](./dev/dump1090prom.service) and copy it
49+
If you use Linux with systemd, you can use [this systemd unit file](./dev/dump1090prom.service) and copy it
5050
to `/etc/systemd/system/dump1090prom.service`. You may want to adjust the `port` and add custom parameters in `ExecStart`.
5151
Look for the Configuration and CLI section below for more information.
5252

@@ -69,28 +69,32 @@ env GOOS=linux GOARCH=arm go build -o dump1090prom
6969

7070
The exporter is configured via command-line flags:
7171

72-
- `-base-url` string
72+
- `-base-url` `string`
7373
Base URL to the directory where aircraft.json and receiver.json are available
74-
- `-base-path` string
74+
- `-base-path` `string`
7575
Local filesystem directory containing aircraft.json and receiver.json, e.g. /var/www/html/data
76-
- `-lat` float
76+
- `-lat` `float`
7777
Override receiver latitude (used for distance calculation)
78-
- `-lon` float
78+
- `-lon` `float`
7979
Override receiver longitude (used for distance calculation)
80-
- `-host` host (default: `127.0.0.1`)
80+
- `-host` `host` (default: `127.0.0.1`)
8181
Override host where /metrics is exposed
82-
- `-port` port (default: `8080`)
82+
- `-port` `port` (default: `8080`)
8383
Override port where /metrics is exposed
84-
- `-verbose` bool (default: `false`)
84+
- `-verbose` `bool` (default: `false`)
8585
Enable verbose logging
86-
- `-distance-calc` bool (default: `true`)
86+
- `-distance-calc` `bool` (default: `true`)
8787
Enable distance calculation to aircraft
88-
- `-airline-label` bool (default: `true`)
88+
- `-airline-label` `bool` (default: `true`)
8989
Enable airline labelling
90-
- `-expose-files` bool (default: `true`)
90+
- `-expose-files` `bool` (default: `true`)
9191
Expose original aircraft.json and receiver.json files at /aircraft.json and /receiver.json
92-
- `-rolling-map-size` int (default: `1000`)
92+
- `-rolling-map-size` `int` (default: `1000`)
9393
Default size of the rolling map for caching
94+
- `-collector` `string` (default: `dump1090prom`)
95+
Constant 'collector' label value of this instance
96+
- `-labels` `string`
97+
Global labels to add to all metrics (e.g., 'location=home,environment=testing')
9498

9599
Notes:
96100
- When `-lat` and `-lon` are not provided, the exporter will try to read receiver position from `receiver.json`.
@@ -126,16 +130,20 @@ Expose metrics on a different port:
126130
./dump1090prom -base-url http://your-dump1090-server:8080/data -port 9091
127131
```
128132

129-
Typically `dump1090prom` uses `<lat>` and `<lon>` as defined in your `receiver.json`,
130-
if you want to overwrite the receiver position, you can use the `-lat` and `-lon` flags.
133+
Add global labels to all metrics:
134+
```bash
135+
./dump1090prom -base-url http://your-dump1090-server:8080/data -labels "environment=home"
136+
```
137+
138+
Typically, `dump1090prom` uses the `<lat>` and `<lon>` values defined in your `receiver.json`. To override the receiver position, use the `-lat` and `-lon` flags.
131139

132140
```bash
133141
./dump1090prom -base-url http://your-dump1090-server:8080/data -lat <lat> -lon <lon>
134142
```
135143

136144
## Prometheus Configuration
137145

138-
Note: You have to replace `<host_ip>` (and port) with the IP address of your `dump1090prom` server.
146+
Note: Replace `<host_ip>` and port with the IP address of your `dump1090prom` server.
139147

140148
```yaml
141149
scrape_configs:
@@ -169,50 +177,16 @@ http://localhost:8080/receiver.json
169177
170178
All metrics are prefixed with `dump1090prom_`.
171179
172-
```
173-
dump1090prom_aircraft_adsb_version, Type: GAUGE, Description: Version of the ADS-B protocol in use
174-
dump1090prom_aircraft_altitude_baro_feet, Type: GAUGE, Description: Barometric altitude in feet
175-
dump1090prom_aircraft_altitude_geom_feet, Type: GAUGE, Description: Geometric altitude in feet
176-
dump1090prom_aircraft_barometric_vertical_rate_feet_per_minute, Type: GAUGE, Description: Barometric vertical rate in feet per minute
177-
dump1090prom_aircraft_count, Type: GAUGE, Description: Number of different aircraft currently seen
178-
dump1090prom_aircraft_distance_from_position_meters, Type: GAUGE, Description: Distance in meters from the recording position
179-
dump1090prom_aircraft_flight_info, Type: GAUGE, Description: Metadata about the flight and aircraft
180-
dump1090prom_aircraft_geometric_vertical_rate_feet_per_minute, Type: GAUGE, Description: Geometric vertical rate in feet per minute
181-
dump1090prom_aircraft_ground_speed_knots, Type: GAUGE, Description: Ground speed in knots
182-
dump1090prom_aircraft_gva, Type: GAUGE, Description: Geometric Vertical Accuracy
183-
dump1090prom_aircraft_indicated_airspeed_knots, Type: GAUGE, Description: Indicated airspeed in knots
184-
dump1090prom_aircraft_latitude, Type: GAUGE, Description: Latitude of aircraft
185-
dump1090prom_aircraft_longitude, Type: GAUGE, Description: Longitude of aircraft
186-
dump1090prom_aircraft_mach_number, Type: GAUGE, Description: Mach number
187-
dump1090prom_aircraft_magnetic_heading_degrees, Type: GAUGE, Description: Magnetic heading in degrees
188-
dump1090prom_aircraft_mode_a, Type: GAUGE, Description: Mode A (ident) capability (1 if present)
189-
dump1090prom_aircraft_mode_c, Type: GAUGE, Description: Mode C (altitude) capability (1 if present)
190-
dump1090prom_aircraft_nac_p, Type: GAUGE, Description: Navigation Accuracy Category for Position
191-
dump1090prom_aircraft_nac_v, Type: GAUGE, Description: Navigation Accuracy Category for Velocity
192-
dump1090prom_aircraft_nav_altitude_mcp_feet, Type: GAUGE, Description: MCP/FCU selected altitude in feet
193-
dump1090prom_aircraft_nav_heading_degrees, Type: GAUGE, Description: Selected heading in degrees
194-
dump1090prom_aircraft_nav_qnh_millibar, Type: GAUGE, Description: QNH setting in millibars
195-
dump1090prom_aircraft_nic, Type: GAUGE, Description: Navigation Integrity Category
196-
dump1090prom_aircraft_nic_baro, Type: GAUGE, Description: Navigation Integrity Category for barometric altitude
197-
dump1090prom_aircraft_oat, Type: GAUGE, Description: Outside Air Temperature in Celsius
198-
dump1090prom_aircraft_rc, Type: GAUGE, Description: Radius of containment
199-
dump1090prom_aircraft_roll_degrees, Type: GAUGE, Description: Roll angle in degrees
200-
dump1090prom_aircraft_rssi_dbm, Type: GAUGE, Description: Received Signal Strength Indicator in dBm
201-
dump1090prom_aircraft_sda, Type: GAUGE, Description: System Design Assurance
202-
dump1090prom_aircraft_seen_pos_seconds, Type: GAUGE, Description: Seconds since position was last updated
203-
dump1090prom_aircraft_seen_seconds, Type: GAUGE, Description: Seconds since this aircraft was last seen
204-
dump1090prom_aircraft_sil, Type: GAUGE, Description: Surveillance Integrity Level
205-
dump1090prom_aircraft_spi, Type: GAUGE, Description: Special Position Identification (IDENT)
206-
dump1090prom_aircraft_tat, Type: GAUGE, Description: Total Air Temperature in Celsius
207-
dump1090prom_aircraft_track_degrees, Type: GAUGE, Description: Track angle in degrees (0-359)
208-
dump1090prom_aircraft_track_rate_degrees_per_second, Type: GAUGE, Description: Rate of change of track angle in degrees per second
209-
dump1090prom_aircraft_true_airspeed_knots, Type: GAUGE, Description: True airspeed in knots
210-
dump1090prom_aircraft_true_heading_degrees, Type: GAUGE, Description: Selected true heading in degrees
211-
dump1090prom_now_timestamp, Type: GAUGE, Description: Current timestamp in seconds since the epoch
212-
dump1090prom_total_messages, Type: COUNTER, Description: Total number of messages received
213-
```
180+
| Metric Name | Type | Description |
181+
| ----------- | ---- | ----------- |
182+
| `aircraft_flight_info` | Gauge | Metadata about the flight and aircraft (includes airline, country, squawk, etc.). |
183+
| `aircraft_altitude_baro_feet` | Gauge | Barometric altitude in feet. |
184+
| `aircraft_ground_speed_knots` | Gauge | Ground speed in knots. |
185+
| `aircraft_distance_from_position_meters` | Gauge | Distance from the receiver in meters. |
186+
| `aircraft_count` | Gauge | Total number of aircraft currently seen. |
187+
| `total_messages` | Counter | Total number of messages received. |
214188
215-
Additional metrics are available (see [metric.go](./metric.go) for the full list), including heading, vertical rates, ADS-B version, NAV data, and more.
189+
Additional metrics are available for ADS-B version, vertical rates, navigation data, and more. See [metric.go](./metric.go) for a full list or visit the `/metrics` endpoint.
216190
217191
## Development
218192
@@ -228,14 +202,5 @@ The `dev` directory contains resources for setting up a development environment:
228202

229203
- `dev/prometheus`: Prometheus configuration and Podman Compose setup
230204

231-
## License
232-
```
233-
GNU AFFERO GENERAL PUBLIC LICENSE
234-
Version 3, 19 November 2007
235-
236-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
237-
Everyone is permitted to copy and distribute verbatim copies
238-
of this license document, but changing it is not allowed.
239-
```
240-
241-
This project is licensed under the terms of the license included in the [`LICENSE`](./LICENSE) file.
205+
This project is licensed under the terms of the [GNU Affero General Public License v3.0](./LICENSE).
206+
Wikipedia airline data is licensed under [CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).

0 commit comments

Comments
 (0)