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

Activate metrics endpoint on aggregator #2022

Merged
merged 21 commits into from
Oct 22, 2024

Conversation

dlachaume
Copy link
Collaborator

@dlachaume dlachaume commented Oct 18, 2024

Content

This PR includes:

  • Optional activation of a metrics (Prometheus) endpoint on the aggregator node.
  • Computation of the following metrics:
    • certificate_detail_total_served_since_startup (Counter)
    • artifact_detail_cardano_db_total_served_since_startup (Counter)
    • artifact_detail_mithril_stake_distribution_total_served_since_startup (Counter)
    • artifact_detail_cardano_stake_distribution_total_served_since_startup (Counter)
    • artifact_detail_cardano_transaction_total_served_since_startup (Counter)
    • proof_cardano_transaction_total_proofs_served_since_startup (Counter)
    • proof_cardano_transaction_total_transactions_served_since_startup (Counter)
    • signer_registration_total_received_since_startup (Counter)
    • signature_registration_total_received_since_startup (Counter)
    • certificate_total_produced_since_startup (Counter)
    • artifact_cardano_db_total_produced_since_startup (Counter)
    • artifact_mithril_stake_distribution_total_produced_since_startup (Counter)
    • artifact_cardano_stake_distribution_total_produced_since_startup (Counter)
    • artifact_cardano_transaction_total_produced_since_startup (Counter)
    • runtime_cycle_success_since_startup (Counter)
    • runtime_cycle_total_since_startup (Counter)
  • Deployment in the Mithril networks infrastructure.

ab tests on testing-preview BEFORE merging the PR

Number of requests: 1000

ab -n 1000 -c 50 https://aggregator.testing-preview.api.mithril.network/aggregator/certificate/62018d3b945ae75fe2c9749b0bb89f24e51e40c187c4d629edb2d5ce99d006f
  • Run 1
Requests per second:    298.81 [#/sec] (mean)
Time per request:       167.331 [ms] (mean)
Time per request:       3.347 [ms] (mean, across all concurrent requests)
  • Run 2
Requests per second:    295.42 [#/sec] (mean)
Time per request:       169.250 [ms] (mean)
Time per request:       3.385 [ms] (mean, across all concurrent requests)
  • Run 3
Requests per second:    307.03 [#/sec] (mean)
Time per request:       162.853 [ms] (mean)
Time per request:       3.257 [ms] (mean, across all concurrent requests)

Number of requests: 10 000

ab -n 10000 -c 50 https://aggregator.testing-preview.api.mithril.network/aggregator/certificate/62018d3b945ae75fe2c9749b0bb89f24e51e40c187c4d629edb2d5ce99d006f
  • Run 1
Requests per second:    309.23 [#/sec] (mean)
Time per request:       161.694 [ms] (mean)
Time per request:       3.234 [ms] (mean, across all concurrent requests)
  • Run 2
Requests per second:    299.44 [#/sec] (mean)
Time per request:       166.979 [ms] (mean)
Time per request:       3.340 [ms] (mean, across all concurrent requests)
  • Run 3
Requests per second:    312.36 [#/sec] (mean)
Time per request:       160.070 [ms] (mean)
Time per request:       3.201 [ms] (mean, across all concurrent requests)

ab tests on testing-preview AFTER merging the PR

Number of requests: 1000

ab -n 1000 -c 50 https://aggregator.testing-preview.api.mithril.network/aggregator/certificate/62018d3b945ae75fe2c9749b0bb89f24e51e40c187c4d629edb2d5ce99d006f
  • Run 1
Requests per second:    291.38 [#/sec] (mean)
Time per request:       171.595 [ms] (mean)
Time per request:       3.432 [ms] (mean, across all concurrent requests)
  • Run 2
Requests per second:    289.75 [#/sec] (mean)
Time per request:       172.563 [ms] (mean)
Time per request:       3.451 [ms] (mean, across all concurrent requests)
  • Run 3
Requests per second:    291.73 [#/sec] (mean)
Time per request:       171.392 [ms] (mean)
Time per request:       3.428 [ms] (mean, across all concurrent requests)

Number of requests: 10 000

ab -n 10000 -c 50 https://aggregator.testing-preview.api.mithril.network/aggregator/certificate/62018d3b945ae75fe2c9749b0bb89f24e51e40c187c4d629edb2d5ce99d006f
  • Run 1
Requests per second:    285.65 [#/sec] (mean)
Time per request:       175.039 [ms] (mean)
Time per request:       3.501 [ms] (mean, across all concurrent requests)
  • Run 2
Requests per second:    300.41 [#/sec] (mean)
Time per request:       166.438 [ms] (mean)
Time per request:       3.329 [ms] (mean, across all concurrent requests)
  • Run 3
Requests per second:    300.62 [#/sec] (mean)
Time per request:       166.320 [ms] (mean)
Time per request:       3.326 [ms] (mean, across all concurrent requests)

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #1980

@dlachaume dlachaume self-assigned this Oct 18, 2024
Copy link

github-actions bot commented Oct 18, 2024

Test Results

    4 files  ±0     55 suites  ±0   10m 23s ⏱️ +2s
1 379 tests +9  1 379 ✅ +9  0 💤 ±0  0 ❌ ±0 
1 593 runs  +9  1 593 ✅ +9  0 💤 ±0  0 ❌ ±0 

Results for commit 7352335. ± Comparison against base commit 6101238.

♻️ This comment has been updated with latest results.

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I left few comments and suggestions below.

I have also pushed a commit with the missing configuration of the scraping Prometheus endpoint for the aggregator metrics in the infrastructure: a67d64a.

CHANGELOG.md Outdated Show resolved Hide resolved
mithril-aggregator/src/commands/serve_command.rs Outdated Show resolved Hide resolved
mithril-aggregator/src/http_server/routes/proof_routes.rs Outdated Show resolved Hide resolved
mithril-aggregator/src/metrics/service.rs Show resolved Hide resolved
mithril-aggregator/src/metrics/service.rs Outdated Show resolved Hide resolved
mithril-aggregator/src/metrics/service.rs Outdated Show resolved Hide resolved
mithril-aggregator/src/runtime/runner.rs Outdated Show resolved Hide resolved
mithril-aggregator/tests/test_extensions/mod.rs Outdated Show resolved Hide resolved
@dlachaume dlachaume force-pushed the ensemble/1980/expose_prometheus_metrics_for_aggregator branch from d2fe79f to eefc17b Compare October 21, 2024 14:54
@dlachaume dlachaume marked this pull request as ready for review October 21, 2024 14:58
Copy link
Collaborator

@Alenar Alenar left a comment

Choose a reason for hiding this comment

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

LGTM, just two minor issues.

@dlachaume dlachaume force-pushed the ensemble/1980/expose_prometheus_metrics_for_aggregator branch from eefc17b to 90d7374 Compare October 21, 2024 16:25
@dlachaume dlachaume force-pushed the ensemble/1980/expose_prometheus_metrics_for_aggregator branch from 90d7374 to e35d60a Compare October 22, 2024 08:15
dlachaume and others added 5 commits October 22, 2024 10:37
Co-authored-by: Sébastien Fauvel <sfauvel@users.noreply.github.com>
Co-authored-by: DJO <Alenar@users.noreply.github.com>
…d for proof

- Implement `increment_by` function for `MetricCounter` to increment the counter by another value than '1'.
- Renaming of `proof_cardano_transaction_total_served_since_startup` to `proof_cardano_transaction_total_proofs_served_since_startup`.
* mithril-metric from `0.1.0` to `0.1.1`
* mithril-aggregator from `0.5.84` to `0.5.85`
@dlachaume dlachaume force-pushed the ensemble/1980/expose_prometheus_metrics_for_aggregator branch from e35d60a to 7352335 Compare October 22, 2024 08:37
@dlachaume dlachaume merged commit ef8c283 into main Oct 22, 2024
45 checks passed
@dlachaume dlachaume deleted the ensemble/1980/expose_prometheus_metrics_for_aggregator branch October 22, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Prometheus metrics for aggregator
4 participants