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(dynamic_routing): analytics improvement using separate postgres table #6723

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

prajjwalkumar17
Copy link
Contributor

@prajjwalkumar17 prajjwalkumar17 commented Dec 2, 2024

Type of Change

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

Description

Previously we were pushing the Dynamic routing metrics to Prometheus, but due to high cardinality of some values(payment_id) we were not able to add that in our attributes, hence we are pushing this after creating a new table in our Database (dynamic_routing_stats).

Additional Changes

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

Motivation and Context

Required to get the payment_id for our metrics purpose.

How did you test it?

Can be tested in the following ways:

  1. enable success_based_routing(feature = metrics) for merchant.
curl --location --request POST 'http://localhost:8080/account/m_id/business_profile/pro_id/dynamic_routing/success_based/toggle?enable=metrics' \
--header 'api-key:api_key'
  1. Make a payment afterwards.
  2. Check the dynamic_routing_stats table for the specific value associated with the payment_id.
Screenshot 2024-12-03 at 12 13 09 PM

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

@prajjwalkumar17 prajjwalkumar17 requested review from a team as code owners December 2, 2024 17:06
@prajjwalkumar17 prajjwalkumar17 marked this pull request as draft December 2, 2024 17:06
@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Dec 2, 2024
@prajjwalkumar17 prajjwalkumar17 linked an issue Dec 3, 2024 that may be closed by this pull request
@prajjwalkumar17 prajjwalkumar17 self-assigned this Dec 3, 2024
@prajjwalkumar17 prajjwalkumar17 added A-routing Area: Routing C-feature Category: Feature request or enhancement labels Dec 3, 2024
@prajjwalkumar17 prajjwalkumar17 added this to the December 2024 Release milestone Dec 3, 2024
@prajjwalkumar17 prajjwalkumar17 changed the title feature(dynamic_routing): analytics improvement using separate postgres table feature(euclid): analytics improvement using separate postgres table Dec 3, 2024
@prajjwalkumar17 prajjwalkumar17 changed the title feature(euclid): analytics improvement using separate postgres table feat(dynamic_routing): analytics improvement using separate postgres table Dec 3, 2024
@prajjwalkumar17 prajjwalkumar17 marked this pull request as ready for review December 3, 2024 06:36
crates/diesel_models/src/dynamic_routing_stats.rs Outdated Show resolved Hide resolved
crates/router/src/core/routing/helpers.rs Outdated Show resolved Hide resolved
crates/diesel_models/src/dynamic_routing_stats.rs Outdated Show resolved Hide resolved
crates/diesel_models/src/dynamic_routing_stats.rs Outdated Show resolved Hide resolved
crates/router/src/core/routing/helpers.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-routing Area: Routing C-feature Category: Feature request or enhancement M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature(routing): Stats table for dynamic_routing
3 participants