Skip to content

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented Jun 10, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR adds support for gauge metrics. Additionally the pr also adds a background thread, which will be spawned during application startup, that runs for every fixed interval (configurable) of time, collecting the metrics. For now this collector collects the gauge metrics of cache_entry_count of all the cache types.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Hit list payment methods for a merchant endpoint and check for router_CACHE_ENTRY_COUNT metric in grafana

image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Chethan-rao Chethan-rao added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed M-configuration-changes Metadata: This PR involves configuration changes labels Jun 10, 2024
@Chethan-rao Chethan-rao added this to the May 2024 Release milestone Jun 10, 2024
@Chethan-rao Chethan-rao self-assigned this Jun 10, 2024
@Chethan-rao Chethan-rao requested review from a team as code owners June 10, 2024 18:02
@Chethan-rao Chethan-rao linked an issue Jun 10, 2024 that may be closed by this pull request
Comment on lines 11 to 17
crate::gauge_metrics_for_imc!(
CONFIG_CACHE,
ACCOUNTS_CACHE,
ROUTING_CACHE,
CGRAPH_CACHE,
PM_FILTERS_CGRAPH_CACHE
);
Copy link
Member

Choose a reason for hiding this comment

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

We'd have to include DECISION_MANAGER_CACHE and SURCHARGE_CACHE once #4814 is merged. How can we ensure that developers introducing new cache instances add metrics for them here: would including a comment in crates/storage_impl/src/redis/cache.rs be useful, or is there anything else that can be done?

SanchithHegde
SanchithHegde previously approved these changes Jun 11, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 11, 2024
Merged via the queue into main with commit 42cd769 Jun 11, 2024
@likhinbopanna likhinbopanna deleted the add-support-for-guage-metrics branch June 11, 2024 15:07
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-configuration-changes Metadata: This PR involves configuration changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for gauge metrics and include IMC metrics
4 participants