Code Monkey home page Code Monkey logo

dump1090-exporter's Introduction

dump1090 Exporter

Dump1090 is a simple Mode S decoder for RTLSDR devices that is commonly used for tracking aircraft. Dump1090 makes a number of operating metrics available to track the performance of the tool and its environment.

The dump1090exporter collects statistics from dump1090 and exposes it to the Prometheus monitoring server for aggregation and later visualisation (e.g. using Grafana).

This exporter has been reported to work with:

  • the dump1090 mutability fork
  • the dump1090-fa fork
  • readsb

Install

The dump1090 exporter is implemented as a Python3.6+ package that can be installed using the Python package manager pip. It is recommended to install this package into a virtual environment.

$ pip install dump1090exporter

The package can optionally make use of the uvloop package which provides a more efficient implementation of the asyncio event loop.

$ pip install dump1090exporter[uvloop]

The dump1090exporter has also been packaged into a Docker container. See the Docker section below for more details about that.

Run

The dump1090 exporter can be run from the command line using the console entry point script configured as part of the installation.

The dump1090 exporter accepts a number of command line arguments which can be displayed using the standard command line help request.

$ dump1090exporter -h

An example usage is shown below.

$ dump1090exporter \
  --resource-path=http://192.168.1.201:8080/data \
  --port=9105 \
  --latitude=-34.9285 \
  --longitude=138.6007 \
  --log-level info

The --resource-path argument defines the common base path to the various dump1090 resources used by the exporter. The resource path can be a URL or a file system location.

In the example command the exporter is instructed to monitor a dump1090 instance running on a machine with the IP address 192.168.1.201 using the port 8080.

The dump1090exporter can also monitor dump1090 state via the file system if you run it on the same machine as the dump1090 process. In this scenario you would pass a file system path to the --resource-path command line argument.

For example:

$ dump1090exporter \
  --resource-path=/path/to/dump1090-base-dir/data \
  ...

A more concrete example for dump1090-fa would be:

$ dump1090exporter \
  --resource-path=/run/dump1090-fa/ \
  ...

The exporter uses the resources-path value to construct the following resources:

  • {resource-path}/receiver.json
  • {resource-path}/aircraft.json
  • {resource-path}/stats.json

Receiver data is read from {resource-path}/receiver.json every 10 seconds until a location can be obtained. Once a location has been read from the resource then it is only polled every 300 seconds. However, in most cases the dump1090 tool is not configured with the receivers position.

Aircraft data is read from {resource-path}/aircraft.json every 10 seconds. This can be modified by specifying a new value with the --aircraft-interval argument.

Statistics data is read from {resource-path}/stats.json every 60 seconds, as the primary metrics being exported are extracted from the last1min time period. This too can be modified by specifying an alternative value with the --stats-interval argument.

The example command uses the --port argument to instruct the exporter to exposes a metrics service on port 9105. This is where Prometheus would scrape the metrics from. By default the port is configured to use 9105 so it only needs to be specified if you want to change the port to a different value.

The example command uses the --latitude and --longitude arguments to instruct the exporter to use a specific receiver origin (lat, lon). By providing the exporter with the receiver's location it can calculate ranges to aircraft. Note that if the receiver position is set within the dump1090 tool (and accessible from the {resource-path}/receivers.json resource) then the exporter will use that data as the origin.

The metrics that the dump1090 exporter provides to Prometheus can be accessed for debug and viewing using curl or a browser by fetching from the metrics route url. For example:

$ curl -s http://0.0.0.0:9105/metrics | grep -v "#"
dump1090_aircraft_recent_max_range{time_period="latest"} 1959.0337385807418
dump1090_messages_total{time_period="latest"} 90741
dump1090_recent_aircraft_observed{time_period="latest"} 4
dump1090_recent_aircraft_with_multilateration{time_period="latest"} 0
dump1090_recent_aircraft_with_position{time_period="latest"} 1
dump1090_stats_cpr_airborne{time_period="last1min"} 176
dump1090_stats_cpr_airborne{time_period="total"} 18293
...

The metrics exposed by the dump1090-exporter are all prefixed with the dump1090_ string so as to provide a helpful namespacing which makes them easier to find in visualisation tools such as Grafana.

The exporter exposes generalised metrics for statistics and uses the multi dimensional label capability of Prometheus metrics to include information about which group the metric is part of.

To extract information for the peak signal metric that dump1090 aggregated over the last 1 minute you would specify the time_period for that group:

dump1090_stats_local_peak_signal{job="dump1090", time_period="last1min"}

In the stats.json data there are 5 top level keys that contain statistics for a different time period, defined by the "start" and "end" subkeys. The top level keys are:

  • latest which covers the time between the end of the "last1min" period and the current time. In my dump1090 setup this is always empty.
  • last1min which covers a recent 1-minute period. This may be up to 1 minute out of date (i.e. "end" may be up to 1 minute old)
  • last5min which covers a recent 5-minute period. As above, this may be up to 1 minute out of date.
  • last15min which covers a recent 15-minute period. As above, this may be up to 1 minute out of date.
  • total which covers the entire period from when dump1090 was started up to the current time.

By default only the last1min time period is exported as Prometheus can be used for accessing historical data.

Prometheus Configuration

Prometheus needs to be told where to fetch the dump1090 metrics from. The Prometheus configuration file should be updated with a new entry under the 'scrape_configs' block, that looks something like this:

scrape_configs:
  - job_name: 'dump1090'
    scrape_interval: 10s
    scrape_timeout: 5s
    static_configs:
      - targets: ['192.168.1.201:9105']

Visualisation

The Granfana visualisation tool can display nice looking charts and it supports Prometheus. A dump1090export Grafana dashboard has been created to demonstrate how the data provided by the exporter can be visualised.

Docker

The dump1090 exporter has been packaged into a Docker container on DockerHub. This can simplify running it in some environments. The container is configured with an entry point that runs the dump1090 exporter application. The default command argument is --help which will display help information.

$ docker run -it --rm clawsicus/dump1090exporter
usage: dump1090exporter [-h] [--resource-path <dump1090 url>]
...

To run the dump1090 exporter container in your environment simply pass your own custom command line arguments to it:

$ docker run -p 9105:9105 \
  --detach \
  clawsicus/dump1090exporter \
  --resource-path=http://192.168.1.201:8080/data \
  --latitude=-34.9285 \
  --longitude=138.6007

You can then check the metrics being exposed to Prometheus by fetching them using curl.

$ curl http://127.0.0.1:9105/metrics

Next you would configure a Prometheus server to scape the dump1090exporter container on port 9105.

Demonstration

A demonstration environment can be found in the demo directory. It uses Docker Compose to orchestrate containers running dump1090exporter, Prometheus and Grafana to facilitate experimentation with metric collection and graphing.

This provides a really quick and easy method for checking out the dump1090exporter.

Developer Notes

Python Release Process

The following steps are used to make a new software release:

  • Ensure current branch is set to master and is up to date.

  • Create a virtual environment, install dependencies and the dump1090exporter.

    $ make venv
    $ source venv/bin/activate
    (d1090exp) $
  • Ensure all checks are passing.

    (d1090exp) $ make checks
  • Ensure that the version label in __init__.py has been updated.

  • Create the distribution. This project produces an artefact called a pure Python wheel. Only Python3 is supported by this package.

    (d1090exp) $ make dist
  • Upload the new release to PyPI.

    (d1090exp) $ make dist-upload
  • Create and push a repo tag to Github.

    $ git tag YY.MM.MICRO -m "A meaningful release tag comment"
    $ git tag  # check release tag is in list
    $ git push --tags origin master

Docker Release Process

The following steps are used to make a new software release:

  • Generate the dump1090exporter Python package distribution.

    (d1090exp) $ make dist
  • Log in to the Docker user account which will hold the public image.

    (d1090exp) $ docker login
    username
    password
  • Build the dump1090exporter Docker container.

    (d1090exp) $ docker build -t clawsicus/dump1090exporter .
  • Perform a simple test of the container by specifying its full namespace to run that container image.

    $ docker run -it --rm clawsicus/dump1090exporter
    usage: dump1090exporter [-h] [--resource-path <dump1090 url>]
    ...
  • Test the container by configuring it to connect to a dump1090 service.

    $ docker run -p 9105:9105 \
      --detach \
      clawsicus/dump1090exporter \
      --resource-path=http://192.168.1.201:8080/data \
      --latitude=-34.9285 \
      --longitude=138.6007

    Confirm that metrics are being collected and exposed by checking metrics are being exposed to Prometheus by fetching them using curl.

    $ curl http://127.0.0.1:9105/metrics
  • Publish the new container to DockerHub using:

    (d1090exp) $ docker push clawsicus/dump1090exporter:<version>

dump1090-exporter's People

Contributors

claws avatar e-minguez avatar jkstay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dump1090-exporter's Issues

Building Docker image fails

Building the Docker image (on Raspberry Pi and elsewhere) fails at

COPY ./dist/dump1090exporter-*-py3-none-any.whl /tmp/

as there is no /dist folder. Where should this come from i.e. when is it created?

Explicit Python version

Hi!

I'm running into this error:

Installing collected packages: dump1090exporter, aiohttp, aioprometheus, chardet, multidict, async-timeout, yarl, quantile-python
  Running setup.py install for dump1090exporter
      File "/home/pi/dump1090exporter/lib/python3.4/site-packages/dump1090exporter/exporter.py", line 52
        async def fetch(url: str,
                ^
    SyntaxError: invalid syntax

On Raspbian Jessie the default Python is v3.4.
It seems to me this script specifically needs Python 3.5 or higher, judging this explanation of the error mentioned above: https://raspberrypi.stackexchange.com/questions/58416/python3-flagging-async-def-as-invalid-syntax

PS Works fine on macOS 10.12.5 and Python 3.6.
Except I had to comment this line: https://github.com/claws/dump1090-exporter/blob/master/dump1090exporter/exporter.py#L13.
Probable cause: "Looks like in version 2.0.0 aiohttp dropped aiohttp.errors".

SyntaxError: invalid syntax

I am receiving the following error when attempting to start dump1090exporter on my piaware unit:

pi@piaware:~ $ dump1090exporter \
>   --url=http://192.168.1.211:8080 \
>   --port=9105 \
>   --latitude=hidden \
>   --longitude=-hidden \
>   --debug
Traceback (most recent call last):
  File "/usr/local/bin/dump1090exporter", line 7, in <module>
    from dump1090exporter.__main__ import main
  File "/usr/local/lib/python3.5/dist-packages/dump1090exporter/__init__.py", line 2, in <module>
    from .exporter import Dump1090Exporter
  File "/usr/local/lib/python3.5/dist-packages/dump1090exporter/exporter.py", line 61
    f"{base_url}/data/receiver.json",
                                   ^
SyntaxError: invalid syntax

When run as a docker container the instance will restart every few seconds. On github, the only issues pertaining to python state it requires >=3.5, of which I am running 3.5. I have tried the variables in " " and receive the same error. I even get the same error when running dump1090exporter -h.
Official PiAware 3.7.2 image
Python 3.5

Export doesn't work

I installed pip install dump1090exporter, but I have an error:

image

PS: exporter stops working. I don't know why. One week ago, it worked perfectly. I reinstalled ubuntu from scratch and tried to install exporter again but without success.

Max Range Is incorrect

When comparing the dump1090 webUI to the info in grafana the max range is totally incorrect
firefox_2018-12-09_20-21-45

json invalid mime-type

I am running your docker version of the code running on my ubuntu 18.04 install. I have the piaware docker running on a pi with the aircraft.json and stats.json files exposed via the web interface.

When I run the docker i get the following error.

Error fetching dump1090 aircraft data: Client error 0, message='Attempt to decode JSON with unexpected mimetype: application/octet-stream', url=URL('http://192.168.2.99:8087/data/aircraft.json'), http://192.168.2.99:8087/data/aircraft.json

However, if i put that url in to any browser or use curl it returns the JSON no problem. From what I found in searching around it seems it could be related aiohttp. Seems it's possible to tell it to ignore mime-type. I tried to modify the code and do a build on my env, but was unsuccessful getting a build so i couldn't fully test.

readsb

Runs without any problems with readsb (on same computer). You could metion that in readme.

unable to pull distance/range stats if dump1090 is started after dump1090exporter

Receiver position in receiver.json is only pulled once during dump1090exporter startup. If failed, origin would be null (unless explicitly set in CLI args) and hence all distance/range calculations would fail until dump1090exporter is restarted.

This is problematic because it creates a race condition on system startup.

This might also lead to incorrect distances in the edge case of changed receiver position without restarting dump1090exporter.

Error running Docker image on Raspberry Pi

Should the dump1090exporter work on a Rasbperry Pi? I'm getting the following error trying to run the container:

pi@piaware:~/dump1090exporter $ sudo docker run -it --rm clawsicus/dump1090exporter
Unable to find image 'clawsicus/dump1090exporter:latest' locally
latest: Pulling from clawsicus/dump1090exporter
ad74af05f5a2: Pull complete
2b032b8bbe8b: Pull complete
a9a5b35f6ead: Pull complete
3245b5a1c52c: Pull complete
032924b710ba: Pull complete
0d7cffe4bfd7: Pull complete
450f5ea3e7ea: Pull complete
b1dca9769b8b: Pull complete
85dea2414bb7: Pull complete
6c0335fd2e33: Pull complete
874418623069: Pull complete
1eb5efc69495: Pull complete
31fd3feaa060: Pull complete
Digest: sha256:1af3fbedcb8749750276c8df85e4c6596313020f6689f61b15fca286620d98c5
Status: Downloaded newer image for clawsicus/dump1090exporter:latest
standard_init_linux.go:211: exec user process caused "exec format error"
failed to resize tty, using default size

Open JSON files locally, as files instead of via http

Currently you have to got the Dump1090 webserver running, so that the files are available via http. Can support be added for reading the files from the Linux filesystem?

dump1090exporter --url "/home/dump1090/" ... ๐Ÿ˜

Support for base dump1090

The exporter in this project supports the mutability/dump1090 fork, used in the FlightAware PiAware package, which exposes the /data/aircraft.json and /data/receiver.json routes.

The base dump1090 tool only exposes /data.json which provides similar data but perhaps in a slightly different format.

It would be nice if this project supported both tools - perhaps via a command line switch to choose.

updated Grafana dashboard

For those interested, the latest Grafana doesn't work with the dash :)

I updated it to support the latest version (5.x) and also changed km to miles on my dash.

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "This dashboard displays dump1090 metrics that get exposed to Prometheus by the dump1090exporter.",
  "editable": true,
  "gnetId": 768,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 0,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 9,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "dump1090_recent_aircraft_observed{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "metric": "dump1090_recent_",
          "refId": "A",
          "step": 2
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "title": "Aircraft Total",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 4,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 19,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "dump1090_recent_aircraft_with_position{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "metric": "dump1090_recent_",
          "refId": "A",
          "step": 2
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "title": "Aircraft w/ Position",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 1,
      "editable": true,
      "error": false,
      "format": "lengthmi",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 8,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 10,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(dump1090_recent_aircraft_max_range{job=\"dump1090\"}*0.00062137)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "metric": "dump1090_aircraft_recent_max_range",
          "refId": "A",
          "step": 2
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "title": "Max Range",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 12,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 11,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "rate(dump1090_messages_total{job=\"dump1090\", time_period=\"latest\"}[1m])",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "metric": "dump1090_aircraft_recent_max_range",
          "refId": "A",
          "step": 2
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "title": "Messages/Sec",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 16,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 13,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": " dbFS",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "dump1090_stats_local_peak_signal_strength_dbFS{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "interval": "1s",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 1
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "timeShift": null,
      "title": "Signal Peak",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 20,
        "y": 0
      },
      "height": "50px",
      "hideTimeOverride": true,
      "id": 12,
      "interval": "5s",
      "isNew": true,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": " dbFS",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "dump1090_stats_local_signal_strength_dbFS{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "metric": "dump1090_aircraft_recent_max_range",
          "refId": "A",
          "step": 2
        }
      ],
      "thresholds": "",
      "timeFrom": "1s",
      "title": "Signal Mean",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 7,
        "w": 18,
        "x": 0,
        "y": 3
      },
      "id": 3,
      "interval": "5s",
      "isNew": true,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "dump1090_recent_aircraft_observed{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "total",
          "metric": "recent_aircraft_observed",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "dump1090_recent_aircraft_with_position{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "W/ position",
          "refId": "C",
          "step": 10
        },
        {
          "expr": "dump1090_recent_aircraft_observed{job=\"dump1090\", time_period=\"latest\"} - dump1090_recent_aircraft_with_position{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Wo/ position",
          "refId": "D",
          "step": 10
        },
        {
          "expr": "dump1090_recent_aircraft_with_multilateration{job=\"dump1090\", time_period=\"latest\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "mlat",
          "refId": "B",
          "step": 10
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Aircraft",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": false,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "#### Aircraft\nThis graph displays the counts of aircraft (e.g unique ICAO) being reported. Aircraft are grouped into total aircraft being reported, aircraft reported with a position, aircraft reported without a position and aircraft reported that have multi-lateration reports.",
      "editable": true,
      "error": false,
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 18,
        "y": 3
      },
      "id": 14,
      "isNew": true,
      "links": [],
      "mode": "markdown",
      "title": "",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 7,
        "w": 18,
        "x": 0,
        "y": 10
      },
      "id": 1,
      "interval": "5s",
      "isNew": true,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(dump1090_recent_aircraft_max_range{job=\"dump1090\"}*0.00062137)",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 2,
          "legendFormat": "{{ time_period }}",
          "metric": "",
          "refId": "A",
          "step": 10
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Maximum Range",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": false,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "lengthmi",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": 0,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "##### Maximum Range\nThis graph displays the maximum range of the currently observed aircraft reporting a position.",
      "editable": true,
      "error": false,
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 18,
        "y": 10
      },
      "id": 15,
      "isNew": true,
      "links": [],
      "mode": "markdown",
      "title": "",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 7,
        "w": 18,
        "x": 0,
        "y": 17
      },
      "id": 8,
      "interval": "5s",
      "isNew": true,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(dump1090_messages_total{job=\"dump1090\", time_period=\"latest\"}[1m])",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "latest",
          "metric": "dump1090_messages_total",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "dump1090_stats_messages_total{job=\"dump1090\", time_period=\"last1min\"} / 60",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "last1min",
          "refId": "B",
          "step": 10
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "messages / sec",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": false,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "##### Messages\nThis graph displays the messages received per second.",
      "editable": true,
      "error": false,
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 18,
        "y": 17
      },
      "id": 16,
      "isNew": true,
      "links": [],
      "mode": "markdown",
      "title": "",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 7,
        "w": 18,
        "x": 0,
        "y": 24
      },
      "id": 5,
      "interval": "5s",
      "isNew": true,
      "legend": {
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "dump1090_stats_local_signal_strength_dbFS{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "mean",
          "metric": "dump1090_stats_local_signal_strength_dbFS",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "dump1090_stats_local_peak_signal_strength_dbFS{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "peak",
          "metric": "dump1090_stats_local_peak_signal_strength_dbFS",
          "refId": "B",
          "step": 10
        },
        {
          "expr": "dump1090_stats_local_noise_level_dbFS{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "noise",
          "metric": "dump1090_stats_local_noise_level_dbFS",
          "refId": "C",
          "step": 10
        }
      ],
      "thresholds": [
        {
          "colorMode": "custom",
          "line": true,
          "lineColor": "rgba(241, 13, 41, 0.27)",
          "op": "gt",
          "value": -3
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Signal Strength",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": false,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "dbFS",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "##### Signal Strength\nThis graph displays the signal levels reported for noise, mean and peak signal levels. The values are reported in [dbFS](https://en.wikipedia.org/wiki/DBFS).",
      "editable": true,
      "error": false,
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 18,
        "y": 24
      },
      "id": 17,
      "isNew": true,
      "links": [],
      "mode": "markdown",
      "title": "",
      "type": "text"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "editable": true,
      "error": false,
      "fill": 0,
      "grid": {},
      "gridPos": {
        "h": 7,
        "w": 18,
        "x": 0,
        "y": 31
      },
      "id": 7,
      "interval": "5s",
      "isNew": true,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "connected",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "dump1090_stats_cpu_demod_milliseconds{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "demod",
          "metric": "",
          "refId": "B",
          "step": 10
        },
        {
          "expr": "dump1090_stats_cpu_reader_milliseconds{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "usb",
          "metric": "",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "dump1090_stats_cpu_background_milliseconds{job=\"dump1090\", time_period=\"last1min\"}",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "other",
          "metric": "",
          "refId": "C",
          "step": 10
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU Utilisation",
      "tooltip": {
        "msResolution": true,
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "ms",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "content": "##### CPU Utilisation\nThis graph displays how much CPU time is used by the dump1090 tool. demod reports the time spent demodulating and decoding data from the USB SDR dongle. usb reports time spent reading sample data from the USB SDR dongle. other reports time spent doing network I/O, processing network messages, and periodic tasks.\n",
      "editable": true,
      "error": false,
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 18,
        "y": 31
      },
      "id": 18,
      "isNew": true,
      "links": [],
      "mode": "markdown",
      "title": "",
      "type": "text"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "dump1090",
  "uid": "jYDJZoviz",
  "version": 3
}

[Discussion] -3dBFS messages and more graphs1090 stuff maybe

Current dashboard compared to graphs1090 is missing some graphs. I am pretty sure to get them it just requires some calculations with the metrics. So this is not really an issue, just a discussion.

So, for example the most important one missing now is -3dBFS messages percentage.

I looked up the metrics and thought it would be this: dump1090_stats_local_strong_signals{job="dump1090", time_period="last1min"} / dump1090_stats_messages_total{time_period="last1min"} *100. However compared to graphs1090 it looks a bit high every now and then.

dump1090-localhost-local_trailing_rate-24h
(Note due to Docker timezone issue Graphs1090 time is 2 hours behind.)

Screenshot_2020-06-27 Aircrafts - Grafana

See for example how 16:00 Graphs1090 / 18:00 Grafana, they report about 3% and 5% respectively.
Or 11:00 Graphs1090 / 13:00 Grafana, 5% and 8%.
Or 03:40 Graphs 1090 / 05:40 Grafana, 2% and 6-8%.

So I am doubting here. Wrong calculation, or just they way the metrics are rendered?

armhf and arm64 builds

Anyway you could build the image for armhf and arm64/aarch64 as well? Would be great for running on a Raspberry Pi!

Possible issue with PiAware v5

I upgraded my RPi to PiAware v5 and I am getting errors in the logs about not being able access aircraft.json and stats.json. I cannot access either of these in the browser either, I get 404 error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.