Skip to content

feat(analytics): add source, service_call and execution_mode to connector events#12714

Open
gopikrishna000 wants to merge 1 commit into
mainfrom
feat/ckh-source-columns
Open

feat(analytics): add source, service_call and execution_mode to connector events#12714
gopikrishna000 wants to merge 1 commit into
mainfrom
feat/ckh-source-columns

Conversation

@gopikrishna000

@gopikrishna000 gopikrishna000 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Closes #12717

What

Tags every connector event with three low-cardinality dimensions so downstream analytics can attribute each call:

column values
source hyperswitch
service_call external (direct connector HTTP) / internal (UCS gRPC)
execution_mode primary / shadow

How

  • New EventSource and ServiceCall enums in common_enums (reusing the existing ExecutionMode), plus three fields on ConnectorEvent.
  • Direct connector calls → hyperswitch / external / primary.
  • UCS gRPC calls → hyperswitch / internal with the execution mode of the leg.
  • The UCS gRPC event is now emitted for the shadow leg as well (previously only the primary leg), so shadow executions are captured as hyperswitch / internal / shadow.
  • Adds the matching LowCardinality(String) columns to the connector_events ClickHouse queue, tables and materialized views.

Behaviour matrix

mode event(s) emitted (source / service_call / execution_mode)
Direct hyperswitch / external / primary
UCS primary hyperswitch / internal / primary
Shadow — primary leg hyperswitch / external / primary
Shadow — UCS leg hyperswitch / internal / shadow

Testing

cargo check -p router -p hyperswitch_interfaces -p common_enums passes.

Companion

UCS side: juspay/hyperswitch-prism#1501

@gopikrishna000 gopikrishna000 requested review from a team as code owners June 11, 2026 12:18
@semanticdiff-com

semanticdiff-com Bot commented Jun 11, 2026

Copy link
Copy Markdown

@XyneSpaces XyneSpaces left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Review Summary

PR: feat(analytics): add source, service_call and execution_mode to connector events
Reviewer: PR Reviewer Agent


Verification Passed

Schema consistency — New columns added to all connector_events tables (queue, main, audit, payout_audit) and all materialized views

Enum namingEventSource and ServiceCall use full words, no abbreviations

Default values — Proper #[default] attributes on enum variants match the PR's behavior matrix

Shadow leg visibility — Removing the ExecutionMode::Primary guard and adding the execution_mode field captures shadow executions as documented

Error context preservation — No error chains dropped; all connector errors flow through unchanged


Findings

🔍 1. Consider adding a CHANGELOG entry

The behavioral change (shadow leg now emits events) is significant for analytics consumers. Document this in the CHANGELOG or migration notes.


Verdict:Approve — Clean, well-documented analytics enhancement. No blocking issues.

…ctor events

Tags every connector event with three low-cardinality dimensions so downstream
analytics can attribute each call consistently:

  - source: hyperswitch
  - service_call: external (direct connector HTTP) or internal (UCS gRPC)
  - execution_mode: primary or shadow

Direct connector calls are tagged hyperswitch/external/primary. UCS gRPC calls
are tagged hyperswitch/internal with the execution mode of the leg. The UCS gRPC
event is now emitted for the shadow leg as well (previously only the primary
leg), so shadow executions are captured as hyperswitch/internal/shadow.

Adds the matching columns to the connector_events ClickHouse queue, tables and
materialized views.
@gopikrishna000 gopikrishna000 force-pushed the feat/ckh-source-columns branch from 267bacc to 4cf1b9c Compare June 11, 2026 14:41
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.

[FEATURE] Tag connector events with source, service_call and execution_mode dimensions

2 participants