KPrasch
5e63167dc9
skips a test that is planned for removal in #3382
2024-01-23 19:21:26 +01:00
KPrasch
d06bb7af9a
repairs a p2p validity test that implements /ping. Linting.
2024-01-23 19:21:26 +01:00
KPrasch
1f83e2c5ab
baseline unit testing for ping ip utils
2024-01-23 19:21:26 +01:00
KPrasch
28a0cc750e
removes (redundant) trusted proxy allow listing; documents incoming ip handling functions.
2024-01-23 19:21:26 +01:00
KPrasch
fcaf99ee59
mock ipv4 address resolution in MockRestMiddleware
2024-01-23 19:21:26 +01:00
KPrasch
e553014446
properly handle both ipv4 and ipv6 addresses
2024-01-23 19:21:26 +01:00
KPrasch
a712706e7b
adopt the 'global' language convention pertaining to public IPv4 addresses
2024-01-23 19:21:26 +01:00
KPrasch
527640170c
renames _ipv4_to_ipv6 -> _ipv6_to_ipv4
2024-01-23 19:21:26 +01:00
KPrasch
28af3f9eda
Handle public IPv4 address resolution for incoming requests via /ping
2024-01-23 19:21:26 +01:00
derekpierre
6163ff4d25
Add dev newwsfragment for #3405 .
2024-01-23 15:54:46 +01:00
derekpierre
eec504e54b
Round up the value of batch size and thread pool size which are both decimal factors of the threshold; without rounding up small threshold values can experience slower decryption executions for associated ritual.
2024-01-23 15:54:46 +01:00
derekpierre
ffb34ad6f8
Fix test since the number of successful decryption requests can vary because of concurrency, and how the threshold decryption client executes the requests in parallel (thread pool size etc.).
2024-01-23 15:54:46 +01:00
derekpierre
edc4f939c1
Make last scanned block metric a class variable on ActiveRitualTracker.
2024-01-23 13:27:35 +01:00
derekpierre
8535e628c7
Added metric for tracking last scanned block by ritual tracker scanner task.
...
Added test.
2024-01-23 13:27:35 +01:00
derekpierre
931cdde08e
Use prometheus Summary metric for decryption request count/sum instead of Counter for richer metrics including time taken.
2024-01-23 13:27:35 +01:00
derekpierre
c974b94b18
Add test for starting prometheus exporter.
2024-01-23 13:27:35 +01:00
derekpierre
d4651d678b
Update "active_stake" value to be denominated in ether and not wei.
2024-01-23 13:27:35 +01:00
derekpierre
205e94f6fa
Remove unnecessary fixture as parameter from test.
2024-01-23 13:27:35 +01:00
derekpierre
4b5e128936
Add tests for PrometheusMetricsTracker.
2024-01-23 13:27:35 +01:00
derekpierre
6abd173bd6
Check decryption requests metrics values during ritual acceptance test.
2024-01-23 13:27:35 +01:00
derekpierre
18764d7a08
Add specific metric for decryption successes. Renamed metric from errors to failures.
2024-01-23 13:27:35 +01:00
derekpierre
f9bbfc9a9e
Add newsfragment for #3397 .
2024-01-23 13:27:35 +01:00
derekpierre
3a191041de
Increase robustness of prometheus metrics task by implementing a PrometheusMetricsTracker.
2024-01-23 13:27:35 +01:00
derekpierre
720f133693
Move mock_prometheus out of fixtures and into conftest for integration tests to reduce scope now that prometheus is optional.
2024-01-23 13:27:35 +01:00
derekpierre
667ccbe389
Rename key for discovery status gauge.
2024-01-23 13:27:35 +01:00
derekpierre
e9ea0ddb23
Use the correct registry object to unregister some collectors.
2024-01-23 13:27:35 +01:00
derekpierre
5171c012ca
Add prometheus metrics for tracking threshold decryption requests and errors.
2024-01-23 13:27:35 +01:00
derekpierre
c76ef13f9d
Improve help text for --metrics-interval cli parameter.
2024-01-23 13:27:35 +01:00
derekpierre
31cf9c646d
Add newsfragment for #3388 .
2024-01-23 13:27:35 +01:00
derekpierre
ec22fcbc49
Fix comment.
2024-01-23 13:27:35 +01:00
derekpierre
0cecdef487
Add test for OperatorMetricsCollector.
2024-01-23 13:27:35 +01:00
derekpierre
e3bbd84ffd
Create OperatorMetricsCollector to collect data about matic balance and operator confirmation (better to check confirmation on child application).
...
Move operator confirmation metric from StakingProviderInfo collector to Operator collector.
2024-01-23 13:27:35 +01:00
derekpierre
236e03343f
Rename existing metrics values to remove _gauge suffix.
2024-01-23 13:27:35 +01:00
derekpierre
5fef462501
Update prometheus test for non-default interval collection.
2024-01-23 13:27:35 +01:00
derekpierre
7bffda41fe
Fix failing test; prometheus must be enabled.
2024-01-23 13:27:35 +01:00
derekpierre
e86e2b7cc6
Make enabling prometheus optional.
...
Allow metrics-port to be specified via cli option.
2024-01-23 13:27:35 +01:00
KPrasch
8dbaaaa8fd
Apply suggestions from code review
...
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2024-01-23 13:27:35 +01:00
Manuel Montenegro
253a2067e3
Remove unused metrics
2024-01-23 13:27:35 +01:00
Manuel Montenegro
9512d7b286
Convert node discovery metrics from enum to gauge
...
Actually, the two possible states for learning_status metric are
`stopped` and `running`. So a enum type metric can be considered an
overkill that introduces confusion to exported metrics.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
933a28697d
Add metrics for root and child networks
...
Up to now, there is any distinction between root and child networks, so
the only metrics about Blockchain was related to root network.
This change splits the metrics into two networks.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
920df0e47d
Remove Operator and Event metrics
...
- Event metrics collector was not being used at all, so we can safely
remove it.
- Operator metrics collector is exporting the operator eth balance,
which is not relevant anymore.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
4cca43c0a6
Format code
2024-01-23 13:27:35 +01:00
Manuel Montenegro
e6c5293779
Move imports to the top of the file
...
Since commit de85e7fa
, prometheus is a required dependency for Ursula.
So conditional imports of prometheus are no longer necessary.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
13948b2625
Remove unused code and TODO
2024-01-23 13:27:35 +01:00
Manuel Montenegro
6a72807aec
Add Prometheus metrics endpoint to running logs
2024-01-23 13:27:35 +01:00
Manuel Montenegro
e51d637706
Add integration test for prometheus exporter
...
Test if start_prometheus_exporter has been properly called when running
Ursula.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
8c914ba30f
Remove redundant code in test_prometheus.py
2024-01-23 13:27:35 +01:00
Manuel Montenegro
2e6ed2f29c
Add CLI tests for Prometheus
2024-01-23 13:27:35 +01:00
Manuel Montenegro
7f82edd7ab
Make Prometheus exporter always run along Ursula
...
Prometheus metrics is going to be a necessary part for the Threshold
network. Through them, the network can know if the PRE nodes are meeting
the nodes requirement. This can be useful, for instance, to calculate
the staking rewards.
So, the export of these metrics must be mandatory and not an option that
the user can enable or disable using commands flags.
2024-01-23 13:27:35 +01:00
Manuel Montenegro
78bbeb7dc1
Add mock for prometheus exporter start function
...
Since Prometheus exporter has become a non-optional part of Ursula, the
function start_prometheus_exporter is always called when running a new
Ursula.
Some tests, like test_ursula_run_ip_checkup runs several Ursulas, so
this function is called multiple times.
Only one instance of Prometheus exporter must be run at same time, so
this make the tests to fail because some Prometheus errors are raised.
Co-authored-by: LunarBytes <kieran@nucypher.com>
2024-01-23 13:27:35 +01:00