Skip to content

feat(analytics): refactor and rewrite authentication related analytics#7433

Merged
likhinbopanna merged 2 commits intomainfrom
authentication-analytics
Mar 6, 2025
Merged

feat(analytics): refactor and rewrite authentication related analytics#7433
likhinbopanna merged 2 commits intomainfrom
authentication-analytics

Conversation

@tsdk02
Copy link
Contributor

@tsdk02 tsdk02 commented Mar 5, 2025

Type of Change

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

Description

Refactored and re-wrote the authentication related analytics.
The table being queried is now authentications.

The following metrics were modified:

  • Authentication Attempt Count
  • Authentication Count
  • Authentication Success Count
  • Challenge Attempt Count
  • Challenge Flow Count
  • Challenge Success Count
  • Frictionless Flow Count
  • Frictionless Success Count

Additional Changes

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

Motivation and Context

Get better insights into authentications related data through analytics

How did you test it?

Hit the following curls:

Authentication Attempt Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "authentication_attempt_count" 
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": 80,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Authentication Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "authentication_count"  
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": 95,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Authentication Success Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "authentication_success_count"   
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": 75,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Challenge Flow Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "challenge_flow_count"
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": 1,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Challenge Attempt Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "challenge_attempt_count" 
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": 1,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Challenge Sccess Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "challenge_success_count"   
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": 1,
            "frictionless_flow_count": null,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Frictionless Flow Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "frictionless_flow_count"
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": 74,
            "frictionless_success_count": null,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Frictionless Success Count:

curl --location 'http://localhost:8080/analytics/v1/metrics/auth_events' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: hyperswitch' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYWFiNWIxNDEtNjQwOC00YTUyLTk2MjMtNTVhNTgxMTU1M2U4IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQwNDE0OTA5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTI3NDY4NSwib3JnX2lkIjoib3JnX1QwSEtYNHYyRGFRT2lHUDVwRk52IiwicHJvZmlsZV9pZCI6InByb19xOWc2ZW1xcGM3YjQxTG83VVhweCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.LIExs1jjG6N5AFu5_S3oiuy77fWF0IbJmNGbK8HHLXI' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
    {
        "timeRange": {
            "startTime": "2025-02-01T18:30:00Z",
            "endTime": "2025-02-28T09:22:00Z"
        },
        "source": "BATCH",
        "timeSeries": {
            "granularity": "G_ONEDAY"
        },
        "metrics": [
            "frictionless_success_count"
        ],
        "delta": true
    }
]'

Sample Output:

{
    "queryData": [
        {
            "authentication_count": null,
            "authentication_attempt_count": null,
            "authentication_success_count": null,
            "challenge_flow_count": null,
            "challenge_attempt_count": null,
            "challenge_success_count": null,
            "frictionless_flow_count": null,
            "frictionless_success_count": 74,
            "time_bucket": null
        }
    ],
    "metaData": [
        {
            "current_time_range": {
                "start_time": "2025-02-01T18:30:00.000Z",
                "end_time": "2025-02-28T09:22:00.000Z"
            }
        }
    ]
}

Queries:

Authentication Attempt Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status != 'pending' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Authentication Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Authentication Success Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status = 'success' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Challenge Attempt Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status = 'C' AND authentication_status != 'pending' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Challenge Flow Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status = 'C' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Challenge Success Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND authentication_status = 'success' AND trans_status = 'C' AND created_at >= '1726079400' AND created_at <= '1727256120' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Frictionless Flow Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status = 'Y' AND created_at >= '1738402351' AND created_at <= '1740216751' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

Frictionless Success Count:

SELECT sum(sign_flag) as count, min(created_at) as start_bucket, max(created_at) as end_bucket FROM authentications WHERE ( merchant_id = 'merchant_1740414909' AND trans_status = 'Y' AND authentication_status = 'success' AND created_at >= '1738402351' AND created_at <= '1740216751' ) GROUP BY toStartOfDay(created_at) HAVING sum(sign_flag) >= '1'

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

@tsdk02 tsdk02 added C-refactor Category: Refactor A-Analytics labels Mar 5, 2025
@tsdk02 tsdk02 self-assigned this Mar 5, 2025
@tsdk02 tsdk02 requested a review from a team as a code owner March 5, 2025 09:12
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 5, 2025

@tsdk02 tsdk02 linked an issue Mar 5, 2025 that may be closed by this pull request
@likhinbopanna likhinbopanna added this pull request to the merge queue Mar 6, 2025
Merged via the queue into main with commit 1ff273e Mar 6, 2025
18 of 24 checks passed
@likhinbopanna likhinbopanna deleted the authentication-analytics branch March 6, 2025 11:36
tsdk02 added a commit that referenced this pull request Mar 6, 2025
#7433)

Co-authored-by: Sandeep Kumar <sandeep.kumar@Sandeep-Kumar-LVF93XQXPC.local>
tsdk02 added a commit that referenced this pull request Mar 6, 2025
#7433)

Co-authored-by: Sandeep Kumar <sandeep.kumar@Sandeep-Kumar-LVF93XQXPC.local>
pixincreate added a commit that referenced this pull request Mar 7, 2025
* 'main' of github.com:juspay/hyperswitch:
  feat(hipay): Add Template PR (#7360)
  chore(version): 2025.03.07.0
  chore(postman): update Postman collection files
  feat(analytics): add new filters, dimensions and metrics for authentication analytics (#7451)
  feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields (#7429)
  feat(analytics): refactor and rewrite authentication related analytics (#7433)
  refactor(core): Added payment id in authentication router data (#7441)
  feat(connector): Added ThreeDs server integration template pr (#7424)
  fix(xendit): Fix wasm changes (#7419)
  chore(postman): postman tests fixes (#7159)
  ci(cypress): move customer acceptance in configs to a const within commons (#7435)
  feat(core): add additional revenue recovery call flow (#7402)
  chore(version): 2025.03.06.0
  feat(payment_link): expose payment link configs for SDK UI rules and payment button (#7427)
pixincreate added a commit that referenced this pull request Mar 7, 2025
…juspay/hyperswitch into connector/gpay-mandates-authorizedotnet

* 'connector/gpay-mandates-authorizedotnet' of github.com:juspay/hyperswitch: (25 commits)
  ci(cypress): address lints and refactor redirection handler (#7437)
  chore: make v1 merchant account forward compatible (#7426)
  fix(dashboard): Added auth key to juspay threeds server (#7457)
  feat(hipay): Add Template PR (#7360)
  chore(version): 2025.03.07.0
  chore(postman): update Postman collection files
  feat(analytics): add new filters, dimensions and metrics for authentication analytics (#7451)
  feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields (#7429)
  feat(analytics): refactor and rewrite authentication related analytics (#7433)
  refactor(core): Added payment id in authentication router data (#7441)
  feat(connector): Added ThreeDs server integration template pr (#7424)
  fix(xendit): Fix wasm changes (#7419)
  chore(postman): postman tests fixes (#7159)
  ci(cypress): move customer acceptance in configs to a const within commons (#7435)
  feat(core): add additional revenue recovery call flow (#7402)
  chore(version): 2025.03.06.0
  feat(payment_link): expose payment link configs for SDK UI rules and payment button (#7427)
  feat(connector): [EFT] Add EFT as a payment method (#7304)
  chore(version): 2025.03.05.1
  feat(connector): [Moneris] Implement mandate for Moneris (#7322)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Analytics C-refactor Category: Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(analytics): refactor and rewrite authentication related analytics

4 participants