Commit Graph

11795 Commits (fafff095db1a4a99f9a2f93935a7ff993a41388b)

Author SHA1 Message Date
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
Kieran Prasch d13c398278 newsfrag for PR #3310 2024-01-23 13:27:35 +01:00
Kieran Prasch e81289ab18 Relock dependencies with prometheus-client as a primary dependency. 2024-01-23 13:27:35 +01:00
Manuel Montenegro 7f70c9a086 Disable default collector metrics
By default, prometheus exports 'process', 'gc' and 'platform' collector
metrics. This information is not useful in our case and introduces some
noise to the metrics, so they have been disabled.
2024-01-23 13:27:35 +01:00
Manuel Montenegro 11f973a97a Rename host Prometheus metrics
- host_info has been renamed to client_info
- node_discovery has been renamed to node_discovery_status
- New field for client_info: `app: TACo`
2024-01-23 13:27:35 +01:00
Manuel Montenegro 40628ae991 Remove metrics prefix 2024-01-23 13:27:35 +01:00
Manuel Montenegro ac1893cd50 Remove optional imports of Prometheus
Prometheus is now a dependency that is always installed along with
nucypher. For this reason, it doesn't make sense to check if Prometheus
is installed before importing it.
2024-01-23 13:27:35 +01:00
Manuel Montenegro 97ab6bc23b updates setup.py 2024-01-23 13:27:35 +01:00
KPrasch 2ae6ce85b0
Merge pull request #3393 from cygnusv/nojoin
Optimize use of decryption request WorkerPool
2024-01-19 15:01:36 +01:00
David Núñez 5212834c38
newsfragment for 3393 2024-01-19 12:54:25 +01:00
David Núñez 55e653cf75
Tweak WorkerPool parameters 2024-01-19 12:13:15 +01:00
derekpierre a508765671 Add newsfragment for #3333. 2024-01-19 11:04:31 +01:00
derekpierre 4100754976 Raise exception for sampling when there aren't enough nodes to sample. 2024-01-19 11:04:31 +01:00
derekpierre 76b9d4af28 Add unit tests for testing MergedReservoir and PrefetchStrategy. 2024-01-19 11:04:31 +01:00
derekpierre bad425f17f Raise exception when the reservoir of values to draw from is less than required successes. 2024-01-19 11:04:31 +01:00
Piotr Roslaniec b0f9fe1897 fix darker linting 2024-01-18 12:41:45 +01:00
Piotr Roslaniec d001eab84b add a newsfragment 2024-01-18 12:41:45 +01:00
Piotr Roslaniec 04b3202877 set MAX_UPLOAD_CONTENT_LENGTH to 250kb 2024-01-18 12:41:45 +01:00
David Núñez deb3391131
Increment DEFAULT_DECRYPTION_TIMEOUT to 30 sec 2024-01-17 16:32:52 +01:00
David Núñez 773fa467a6
Reraise exceptions inside TDec worker tasks as ThresholdDecryptionRequestFailed 2024-01-17 16:32:00 +01:00
David Núñez a7af04beb8
Randomize sequence of addresses for decryption requests 2024-01-17 16:26:55 +01:00
David Núñez d0c25cf8d4
Include batch_size as a parameter of ThresholdDecryptionRequestFactory 2024-01-17 15:35:12 +01:00
derekpierre a8c68109ab Add auto-use fixture to limit maximum post aggregation delay. 2024-01-17 09:31:32 -05:00
derekpierre 5163aed044 Use ritual id 5 for lynx examples now that ritual 0 is expired. 2024-01-17 09:31:32 -05:00
derekpierre be8820786f Implement a random stagger delay when nodes submit aggregated transcripts. 2024-01-17 09:31:32 -05:00
derekpierre 8a341dd87c Use an increased modifier for posting aggregation in case node is the last node and needs more gas for additoinal logic of being the last node to submit aggregated transcript.
Basically a race condition for who will be last.
2024-01-17 09:31:32 -05:00
derekpierre 0d71361f88 Have the EventScanner take a break after crashing and then restarting. 2024-01-17 09:31:32 -05:00
derekpierre 2426bacef1 Add bugfix newsfragment for #3390. 2024-01-17 09:31:32 -05:00
derekpierre c5bf021c24 Update tests to have ferveo public keys obtained from CoordinatorAgent/Coordinator contract.
Co-authored-by: Kieran Prasch <kieranprasch@gmail.com>
2024-01-17 09:31:32 -05:00
derekpierre 172fefe74f Obtain node ferveo public key from Coordinator contract instead of learning.
Co-authored-by: Kieran Prasch <kieranprasch@gmail.com>
2024-01-17 09:31:32 -05:00
David Núñez 7e8caefabb
Fix parameter typing 2024-01-17 12:56:16 +01:00
David Núñez dedf747fe2
Fix incorrect exception message 2024-01-17 12:51:44 +01:00
David Núñez 70d7fe1319
Most importantly, no need to wait for all threads to finalize
This was making the whole process as slow as the slowest decryption request
2024-01-17 12:51:12 +01:00
David Núñez e19dd65b3c
Wait enough time before firing a new batch of decryption requests 2024-01-17 12:50:26 +01:00
David Núñez 30a39c59d8
Batch size should start with a bit over the threshold, just in case 2024-01-17 12:48:49 +01:00
David Núñez 43df0adf7b
Fix parameter name 2024-01-17 12:47:02 +01:00
derekpierre c0a59d48d7
Bump version: 7.0.4 → 7.1.0 2024-01-10 11:56:45 -05:00