-
Notifications
You must be signed in to change notification settings - Fork 2.7k
chore(kms-connector): more granular metrics #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements more granular Prometheus metrics for the kms-connector by adding labels to distinguish between different event and response types. Previously, metrics aggregated all types together; now they're broken down by event type (public_decryption_request, user_decryption_request, etc.) and response type.
Key Changes:
- Converted all metrics from
IntCountertoIntCounterVecwithevent_typeorresponse_typelabels - Added new gauge metrics for tracking pending events and responses in the database
- Consolidated and renamed kms-worker metrics (decryption/key_management → grpc)
- Added
as_str()methods toEventTypeandKmsResponseKindfor consistent label values
Reviewed changes
Copilot reviewed 14 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| kms-connector/crates/tx-sender/src/monitoring/metrics.rs | Converted counters to counter vecs with labels; added new gauge metrics with background update job |
| kms-connector/crates/tx-sender/src/core/tx_sender.rs | Updated metric calls to use label values from response.as_str() |
| kms-connector/crates/tx-sender/src/core/kms_response_picker/picker.rs | Updated metric calls to use label values from notification |
| kms-connector/crates/tx-sender/src/core/kms_response_picker/notifier.rs | Added response_str() method and Display implementation for consistent labeling |
| kms-connector/crates/kms-worker/src/monitoring/metrics.rs | Consolidated and renamed metrics; converted to counter vecs with event type labels |
| kms-connector/crates/kms-worker/src/core/event_processor/kms_client.rs | Updated all gRPC request/response metric calls to use EventType for labeling |
| kms-connector/crates/kms-worker/src/core/event_picker/picker.rs | Replaced EventNotification enum with EventType; updated metric calls |
| kms-connector/crates/kms-worker/src/core/event_picker/notifier.rs | Removed EventNotification enum; now uses EventType from utils crate |
| kms-connector/crates/gw-listener/src/monitoring/metrics.rs | Converted counters to counter vecs; removed EVENT_STORED_COUNTER and EVENT_STORAGE_ERRORS |
| kms-connector/crates/gw-listener/src/core/gw_listener.rs | Updated metric calls with labels; removed EVENT_STORAGE_ERRORS increment |
| kms-connector/crates/gw-listener/src/core/publish.rs | Removed EVENT_STORED_COUNTER increment |
| kms-connector/crates/utils/src/types/kms_response.rs | Added as_str() method and constants for response type labels |
| kms-connector/crates/utils/src/types/db.rs | Added TryFrom<PgNotification>, pg_notification(), and as_str() methods for EventType; defined notification constants |
| kms-connector/Cargo.toml | Updated fhevm_gateway_bindings from v0.10.0-2 to v0.10.0 |
| kms-connector/Cargo.lock | Updated fhevm_gateway_bindings dependency reference |
| kms-connector/.sqlx/*.json | Added sqlx offline compilation cache files for new database queries |
Files not reviewed (4)
- kms-connector/.sqlx/query-05f22646520c5835fc3235aa6378dccd4436ca4a07ab25a9c8abe21760d5b202.json: Language not supported
- kms-connector/.sqlx/query-17db0e005e1367157721bf62877d735a9fb755f5d9afe72f069a1872ff1b7fd6.json: Language not supported
- kms-connector/.sqlx/query-a70444056f27bd68660c86bade10eccfac9cb5fd677de32dcc7bea043d3ca237.json: Language not supported
- kms-connector/.sqlx/query-f4cec78c0611edc0cf747320db7f0fb1c9eaec89303c3f3e45617b155fa9aed8.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ddffd24 to
c837960
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 19 changed files in this pull request and generated 4 comments.
Files not reviewed (4)
- kms-connector/.sqlx/query-05f22646520c5835fc3235aa6378dccd4436ca4a07ab25a9c8abe21760d5b202.json: Language not supported
- kms-connector/.sqlx/query-17db0e005e1367157721bf62877d735a9fb755f5d9afe72f069a1872ff1b7fd6.json: Language not supported
- kms-connector/.sqlx/query-a70444056f27bd68660c86bade10eccfac9cb5fd677de32dcc7bea043d3ca237.json: Language not supported
- kms-connector/.sqlx/query-f4cec78c0611edc0cf747320db7f0fb1c9eaec89303c3f3e45617b155fa9aed8.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dbb0409 to
74c9a38
Compare
74c9a38 to
345a971
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 18 out of 24 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- kms-connector/.sqlx/query-05f22646520c5835fc3235aa6378dccd4436ca4a07ab25a9c8abe21760d5b202.json: Language not supported
- kms-connector/.sqlx/query-17db0e005e1367157721bf62877d735a9fb755f5d9afe72f069a1872ff1b7fd6.json: Language not supported
- kms-connector/.sqlx/query-a70444056f27bd68660c86bade10eccfac9cb5fd677de32dcc7bea043d3ca237.json: Language not supported
- kms-connector/.sqlx/query-f4cec78c0611edc0cf747320db7f0fb1c9eaec89303c3f3e45617b155fa9aed8.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8a4cd6d to
4018fc9
Compare
dartdart26
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
@Mergifyio queue |
🟠 Waiting for conditions to match
|
Merge Queue Status🟠 Waiting for queue conditions Required conditions to enter a queue
|
Closes https://github.com/zama-ai/fhevm-internal/issues/721
Some examples extracted for a local e2e tests run: