Prometheus exposition
Prometheus is an event monitoring and alerting system, based on a time series database. It
is commonly used to monitor IT-systems such as servers and the applications they run. If enabled through prometheus →
enable
in the configuration, RctMon exposes its internal state, ready to be scraped by one or more Prometheus
servers. For a nice graphical representation of the collected data, Grafana is recommended.
Configuration
If enabled, the endpoint can be configured using prometheus → bind_address
and prometheus → bind_port
. For
example, to make them accessible from the same machine only, specify 127.0.0.1
or localhost
for
bind_address
. The port can also be changed from the default, by setting bind_port
to (for example) 8080
.
The combination will make the metrics available at http://localhost:8080/metrics
.
In addition to that, if both prometheus → enable
and prometheus → exposition
are enabled, the readings from
the inverter will be available here, too. The values are cached internally, as the inverters responses are too slow for
live readings. This in turn allows for redundant scraping from multiple Prometheus servers at high frequency without
affecting the inverter in any way.
Prometheus configuration
In prometheus.yml
(usually in /etc/prometheus/
), add the endpoint to the scrape_config
, for example like
so:
scrape_configs:
- job_name: rctmon
static_configs:
- targets:
- localhost:8080
The default place for metrics is /metrics
, thus specifying the host and port is enough. Note that the exposition
does not support TLS encryption or any form of authentication and adding that is not planed. If required, configure
a reverse proxy such as HAProxy, Nginx or Apache.
InfluxDB configuration
InfluxDB 2.x is able to scrape Prometheus endpoints. This may be useful for monitoring the application state with
InfluxDB rather than Prometheus. It doesn't make sense to enable prometheus → exposition
in this case as the
application can push the inverter metrics to InfluxDB just fine.
Please refer to the Manage scrapers section in the InfluxDB manual.
Application metrics / monitoring
The metrics meant for monitoring the application are always present when the Prometheus endpoint is active. Some of
them stem from the default python and process exporter built into the library that is used to create the endpoint.
They start with python_
and process_
and are usually of low interest.
All metrics from RctMon start with the string rctmon_
. Due to the design of the library, for each metric an
additional metric is created, ending in _created
. This is due to the OpenMetrics format supported by the library
and can't be deactivated.
As of version 0.0.1
, the following metrics are exposed:
Name |
Type |
Description |
---|---|---|
|
Gauge |
Amount of bytes received from the inverter since start of the program |
|
Gauge |
Amount of bytes sent to the inverter since the start of the program |
|
Gauge |
Amount of errors that occured during parsing and decoding responses from
the inverter. The |
|
Gauge |
Shows if the connection to the inverter is up ( |
|
Gauge |
Amount of frames received since the start of the program (not including decode errors) |
|
Gauge |
Amount of frames sent since the start of the program. |
|
Info |
Information about the program, such as its version. |
Inverter metrics
These become available if prometheus → exposition
is enabled. It may take a moment after program start for them to
appear as the inventory of the inverter needs to be queried before the values can be requested from it.
They all have a label inverter
which contains the name of the inverter. This is the same name as shown in the
smartphone app made by RCT (internally called android_description
).
Percentages are generally in the range 0.0
to 1.0
.
Warning
RctMon is still in development, individual metrics may be added, removed or renamed without prior notice!
Name |
Description |
---|---|
|
A |
|
Shows info about island mode status.
If value is |
|
Shows static info such as the |
|
Voltage, label |
|
Watt, label |
|
MPP target voltage, label |
|
MPP search step, label |
|
Component temperature for builtin components |
|
Household load over all phases |
|
Single-phase load, label |
|
Grid power, label |
|
Grid voltage, label |
|
Phase-to-phase voltage |
|
Information about the Power Switch component if detected, such
as the |
|
Grid voltage, |
|
Grid frequency, |
|
Inverter frequency if active, |
|
Information about the BMS if detected, |
|
Battery, minimum soc |
|
Battery voltage |
|
Battery power |
|
Battery state (state machine position) |
|
Battery SOC |
|
Battery target SOC |
|
Battery health |
|
Battery temperature |
|
Battery status |
|
Battery impedance |
|
Total amount of discharged energy |
|
Total amount of charged energy |
|