diff --git a/.images.lock.yaml b/.images.lock.yaml index 94ceccb..5427c47 100644 --- a/.images.lock.yaml +++ b/.images.lock.yaml @@ -3,7 +3,7 @@ kind: Config minimumRequiredVersion: 0.30.0 overrides: - image: monero-exporter - newImage: index.docker.io/utxobr/monero-exporter@sha256:da1a13e78a9aeacac10b576824d4195a14bc1e5ba9919770d2f81cb9d32c0d4d + newImage: index.docker.io/utxobr/monero-exporter@sha256:c5c019718c37c40cf4335405d47e7fe46b892e55ff74a712bd49e084c8bb02b1 preresolved: true - image: monero-exporter-grafana newImage: index.docker.io/utxobr/monero-exporter-grafana@sha256:f9c47963d3fb573166881baf1a9f2ad331500e34b4604d430f96957ab7bb1449 diff --git a/README.md b/README.md index 41d1d77..0bb9008 100644 --- a/README.md +++ b/README.md @@ -303,12 +303,14 @@ General information about this node. | monero_info_alternative_blocks | number of blocks alternative to the longest | | monero_info_block_size_limit | maximum hard limit of a block | | monero_info_block_size_median | current median size for computing dynamic fees | +| monero_info_height | current height of the chain | | monero_info_mainnet | whether the node is connected to mainnet | | monero_info_offline | whether the node is offline | -| monero_info_synchronized | | +| monero_info_rpc_connections | number of rpc connections being served by the node | +| monero_info_synchronized | whether the node's chain is in sync with the network| +| monero_info_target_height | target height to achieve to be considered in sync | | monero_info_uptime_seconds_total | for how long this node has been up | - ## License See [LICENSE](./LICENSE). diff --git a/examples/docker-compose.yaml b/examples/docker-compose.yaml index ac52180..e61b47d 100644 --- a/examples/docker-compose.yaml +++ b/examples/docker-compose.yaml @@ -15,7 +15,7 @@ services: command: - --monero-addr=http://127.0.0.1:18081 container_name: monero-exporter - image: index.docker.io/utxobr/monero-exporter@sha256:da1a13e78a9aeacac10b576824d4195a14bc1e5ba9919770d2f81cb9d32c0d4d + image: index.docker.io/utxobr/monero-exporter@sha256:c5c019718c37c40cf4335405d47e7fe46b892e55ff74a712bd49e084c8bb02b1 network_mode: service:monerod monerod: command: diff --git a/hack/table-printer.awk b/hack/table-printer.awk index 0f91d9e..4e946c9 100755 --- a/hack/table-printer.awk +++ b/hack/table-printer.awk @@ -5,7 +5,7 @@ # # [1] - https://help.github.com/articles/organizing-information-with-tables/ # -# Usage: `curl -s localhost:9100/metrics | grep container_ | ./gh-table-printer` +# Usage: `curl -s localhost:9000/metrics | grep monero_ | ./gh-table-printer` BEGIN { print "| name | description |" diff --git a/pkg/collector/collector_overall.go b/pkg/collector/collector_info.go similarity index 78% rename from pkg/collector/collector_overall.go rename to pkg/collector/collector_info.go index f63ce7d..61ca60c 100644 --- a/pkg/collector/collector_overall.go +++ b/pkg/collector/collector_info.go @@ -122,12 +122,42 @@ func (c *OverallCollector) collect() { c.metricsC <- prometheus.MustNewConstMetric( prometheus.NewDesc( "monero_info_synchronized", - "", + "whether the node's chain is in sync with the network", nil, nil, ), prometheus.GaugeValue, boolToFloat64(c.info.Synchronized), ) + + c.metricsC <- prometheus.MustNewConstMetric( + prometheus.NewDesc( + "monero_info_height", + "current height of the chain", + nil, nil, + ), + prometheus.GaugeValue, + float64(c.info.Height), + ) + + c.metricsC <- prometheus.MustNewConstMetric( + prometheus.NewDesc( + "monero_info_target_height", + "target height to achieve to be considered in sync", + nil, nil, + ), + prometheus.GaugeValue, + float64(c.info.TargetHeight), + ) + + c.metricsC <- prometheus.MustNewConstMetric( + prometheus.NewDesc( + "monero_info_rpc_connections", + "number of rpc connections being served by the node", + nil, nil, + ), + prometheus.GaugeValue, + float64(c.info.RPCConnectionsCount), + ) } func boolToFloat64(b bool) float64 {