Skip to content
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

feat(prism-agent): Metrics for connection flow job #611

Merged
merged 9 commits into from
Aug 14, 2023

Conversation

shotexa
Copy link
Contributor

@shotexa shotexa commented Aug 3, 2023

Overview

Fixes ATL-4252
Adds metrics for connection operation, and utility functions to measure time between asynchronous operations vai ZIO aspects.

List of metrics added:

  • connection_flow_invitee_connection_request_msg_failed_counter
    • counter that tracks amount of failed attempts for an invitee to send a connection request to the inviter
  • connection_flow_invitee_connection_request_msg_success_counter
    • counter that tracks amount of successful attempts for an invitee to send a connection request to the inviter
  • connection_flow_inviter_connection_response_msg_failed_counter
    • counter that tracks amount of failed attempts for an inviter to send a connection response to the invitee
  • connection_flow_inviter_connection_response_msg_success_counter
    • counter that tracks amount of successful attempts for an inviter to send a connection request to the invitee
  • connection_flow_invitee_process_connection_record_success_counter
    • counter that tracks the number of successful attempts to process connection record by the invitee, this includes getting a record from db, sending a message, and updating the status of the record
  • connection_flow_invitee_process_connection_record_failed_counter
    • counter that tracks the number of failed attempts to process connection record by the invitee, this includes getting a record from db, sending a message, and updating the status of the record
  • connection_flow_invitee_process_connection_record_total_counter
    • counter that tracks the number of total attempts to process a connection record by the invitee
  • connection_flow_inviter_process_connection_record_success_counter
    • counter that tracks the number of successful attempts to process connection record by the inviter, this includes getting a record from db, sending a message, and updating the status of the record
  • connection_flow_inviter_process_connection_record_failed_counter
    • counter that tracks the number of failed attempts to process connection record by the inviter, this includes getting a record from db, sending a message, and updating the status of the record
  • connection_flow_inviter_process_connection_record_total_counter
    • counter that tracks the number of total attempts to process a connection record by the inviter
  • connection_flow_invitee_send_connection_request_ms_gauge
    • the time it takes (in ms) for an invite to send a connection request message to the inviter (Gauge). Connection Id is provided for each metric
  • connection_flow_invitee_pending_to_req_sent_ms_gauge
    • the time it takes (in ms) for the record to be moved from pending state to request sent state on the invitee side (Gauge). Connection Id is provided for each metric
  • connection_flow_invitee_process_connection_record_ms_gauge
    • the time it takes (in ms) for an invitee to process a record (Gauge). Connection Id is provided for each metric
  • connection_flow_inviter_send_connection_response_ms_gauge
    • the time it takes (in ms) for an inviter to send a connection response to the invitee (Gauge). Connection Id is provided for each metric
  • connection_flow_inviter_pending_to_res_sent_ms_gauge
    • the time it takes (in ms) for the record to be moved from the pending state to the response sent state on the inviter side (Gauge). Connection Id is provided for each metric
  • connection_flow_inviter_process_connection_record_ms_gauge
    • the time it takes (in ms) for an inviter to process a record (Gauge). Connection Id is provided for each metric

Checklist

My PR contains...

  • No code changes (changes to documentation, CI, metadata, etc.)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes
  • are not breaking changes
  • If yes to above: I have updated the documentation accordingly

Documentation

  • My changes do not require a change to the project documentation
  • My changes require a change to the project documentation
  • If yes to above: I have updated the documentation accordingly

Tests

  • My changes can not or do not need to be tested
  • My changes can and should be tested by unit and/or integration tests
  • If yes to above: I have added tests to cover my changes
  • If yes to above: I have taken care to cover edge cases in my tests

@shotexa shotexa marked this pull request as draft August 3, 2023 01:37
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

Atala PRISM Test Results

  63 files  ±0    63 suites  ±0   7m 58s ⏱️ -11s
531 tests ±0  520 ✔️ ±0  11 💤 ±0  0 ±0 
534 runs  ±0  523 ✔️ ±0  11 💤 ±0  0 ±0 

Results for commit 2844322. ± Comparison against base commit 301fbab.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@bvoiturier bvoiturier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @shotexa. I left some comments...

@sonarcloud
Copy link

sonarcloud bot commented Aug 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@shotexa shotexa marked this pull request as ready for review August 14, 2023 10:35
@shotexa shotexa changed the title Metrics for connection flow job feat(prism-agent) ATL-4252 - Metrics for connection flow job Aug 14, 2023
@shotexa shotexa changed the title feat(prism-agent) ATL-4252 - Metrics for connection flow job feat(prism-agent): ATL-4252 - Metrics for connection flow job Aug 14, 2023
@github-actions
Copy link
Contributor

E2E Test Results

10 files  ±0  10 suites  ±0   5m 53s ⏱️ +22s
21 tests ±0  21 ✔️ +3  0 💤 ±0  0 ±0 
32 runs  ±0  32 ✔️ +3  0 💤 ±0  0 ±0 

Results for commit 2844322. ± Comparison against base commit 301fbab.

@antonbaliasnikov
Copy link

@shotexa , please, do not add ATL-4252 in the commit title. It's internal information, we agreed that it should go in the PR description, but never appear in the main commits history.

Probably, I need to explicitly add it into guidelines.

@antonbaliasnikov
Copy link

@shotexa , please, removeATL-4252 from PR title (and as the result, from squashed commit title). It's internal information, we agreed that it should go in the PR description, but never appear in the main commits history.

I need to explicitly add it into guidelines.

@shotexa shotexa changed the title feat(prism-agent): ATL-4252 - Metrics for connection flow job feat(prism-agent): Metrics for connection flow job Aug 14, 2023
@shotexa
Copy link
Contributor Author

shotexa commented Aug 14, 2023

@shotexa , please, do not add ATL-4252 in the commit title. It's internal information, we agreed that it should go in the PR description, but never appear in the main commits history.

Probably, I need to explicitly add it into guidelines.

If it has to do with open sourcing, would not people still be able to see the description when it is open sourced?

@shotexa shotexa merged commit 695d661 into main Aug 14, 2023
15 of 19 checks passed
@shotexa shotexa deleted the ATL-4256-add-metrics-for-connection-flow branch August 14, 2023 11:23
count <- connectionRepository
.updateWithConnectionRequest(recordId, request, ProtocolState.ConnectionRequestPending, maxRetries)
.mapError(RepositoryError.apply)
.mapError(RepositoryError.apply) @@ CustomMetricsAspect.startRecordingTime(
s"${record.id}_invitee_pending_to_req_sent"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a metrics which is named invitee_pending_to_req_sent with a label of record.id instead of many different metrics? It won't be possible to compare / sum by record.id if this is a full metric on it's own

atala-dev added a commit that referenced this pull request Aug 16, 2023
# [1.10.0](prism-agent-v1.9.2...prism-agent-v1.10.0) (2023-08-16)

### Bug Fixes

* **prism-agent:** fix OAS on empty DID resolution representation ([#616](#616)) ([216ff3a](216ff3a))

### Features

* **agent:** improve OAS spec and refactor DidCommHttpServer code ([#615](#615)) ([301fbab](301fbab))
* **prism-agent:** Metrics for connection flow job ([#611](#611)) ([695d661](695d661))
* update anoncreds demo after the new getJson methods ([#584](#584)) ([d8258ee](d8258ee))

### Performance Improvements

* support for credential and present-proof flows with thid ([#609](#609)) ([9cef8c0](9cef8c0))
shotexa pushed a commit that referenced this pull request Aug 17, 2023
…epo subject to the Developer Certificate of Origin (DCO), Version 1.1.

695d661 feat(prism-agent): Metrics for connection flow job (#611)
f62d7f5 feat(prism-agent): add http metrics (#585)
a936e86 chore: update to scala 3.3.0, remove unused imports. (#577)
703dccb refactor(prism-agent): Make prism-agent REST API consistent.  (#411)
12dd9c2 Add ADR - Store private keys of Issuers inside prism-agent (#52)
7629dc7 Add common project settings to Iris build.sbt (#50)
3f381cd feat(infra): [ATL-1889] create local deployment config

Signed-off-by: Shota Jolbordi <[email protected]>
@shotexa shotexa mentioned this pull request Aug 17, 2023
14 tasks
shotexa pushed a commit that referenced this pull request Aug 18, 2023
…epo subject to the Developer Certificate of Origin (DCO), Version 1.1

515f92f fix(prism-agenet): Remove connection ID from metrics in connection flow (#635)
695d661 feat(prism-agent): Metrics for connection flow job (#611)
f62d7f5 feat(prism-agent): add http metrics (#585)
a936e86 chore: update to scala 3.3.0, remove unused imports. (#577)
703dccb refactor(prism-agent): Make prism-agent REST API consistent.  (#411)
12dd9c2 Add ADR - Store private keys of Issuers inside prism-agent (#52)
7629dc7 Add common project settings to Iris build.sbt (#50)
3f381cd feat(infra): [ATL-1889] create local deployment config

Signed-off-by: Shota Jolbordi <[email protected]>
antonbaliasnikov pushed a commit that referenced this pull request Aug 21, 2023
…epo subject to the Developer Certificate of Origin (DCO), Version 1.1

515f92f fix(prism-agenet): Remove connection ID from metrics in connection flow (#635)
695d661 feat(prism-agent): Metrics for connection flow job (#611)
f62d7f5 feat(prism-agent): add http metrics (#585)
a936e86 chore: update to scala 3.3.0, remove unused imports. (#577)
703dccb refactor(prism-agent): Make prism-agent REST API consistent.  (#411)
12dd9c2 Add ADR - Store private keys of Issuers inside prism-agent (#52)
7629dc7 Add common project settings to Iris build.sbt (#50)
3f381cd feat(infra): [ATL-1889] create local deployment config

Signed-off-by: Shota Jolbordi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants