mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
feat(connector_events): added api to fetch connector event logs (#3319)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: harsh-sharma-juspay <125131007+harsh-sharma-juspay@users.noreply.github.com>
This commit is contained in:
@ -21,6 +21,7 @@ use crate::{
|
||||
filters::ApiEventFilter,
|
||||
metrics::{latency::LatencyAvg, ApiEventMetricRow},
|
||||
},
|
||||
connector_events::events::ConnectorEventsResult,
|
||||
outgoing_webhook_event::events::OutgoingWebhookLogsResult,
|
||||
sdk_events::events::SdkEventsResult,
|
||||
types::TableEngine,
|
||||
@ -121,6 +122,7 @@ impl AnalyticsDataSource for ClickhouseClient {
|
||||
}
|
||||
AnalyticsCollection::SdkEvents => TableEngine::BasicTree,
|
||||
AnalyticsCollection::ApiEvents => TableEngine::BasicTree,
|
||||
AnalyticsCollection::ConnectorEvents => TableEngine::BasicTree,
|
||||
AnalyticsCollection::OutgoingWebhookEvent => TableEngine::BasicTree,
|
||||
}
|
||||
}
|
||||
@ -147,6 +149,7 @@ impl super::sdk_events::events::SdkEventsFilterAnalytics for ClickhouseClient {}
|
||||
impl super::api_event::events::ApiLogsFilterAnalytics for ClickhouseClient {}
|
||||
impl super::api_event::filters::ApiEventFilterAnalytics for ClickhouseClient {}
|
||||
impl super::api_event::metrics::ApiEventMetricAnalytics for ClickhouseClient {}
|
||||
impl super::connector_events::events::ConnectorEventLogAnalytics for ClickhouseClient {}
|
||||
impl super::outgoing_webhook_event::events::OutgoingWebhookLogsFilterAnalytics
|
||||
for ClickhouseClient
|
||||
{
|
||||
@ -188,6 +191,18 @@ impl TryInto<SdkEventsResult> for serde_json::Value {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryInto<ConnectorEventsResult> for serde_json::Value {
|
||||
type Error = Report<ParsingError>;
|
||||
|
||||
fn try_into(self) -> Result<ConnectorEventsResult, Self::Error> {
|
||||
serde_json::from_value(self)
|
||||
.into_report()
|
||||
.change_context(ParsingError::StructParseFailure(
|
||||
"Failed to parse ConnectorEventsResult in clickhouse results",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl TryInto<PaymentMetricRow> for serde_json::Value {
|
||||
type Error = Report<ParsingError>;
|
||||
|
||||
@ -344,6 +359,7 @@ impl ToSql<ClickhouseClient> for AnalyticsCollection {
|
||||
Self::SdkEvents => Ok("sdk_events_dist".to_string()),
|
||||
Self::ApiEvents => Ok("api_audit_log".to_string()),
|
||||
Self::PaymentIntent => Ok("payment_intents_dist".to_string()),
|
||||
Self::ConnectorEvents => Ok("connector_events_audit".to_string()),
|
||||
Self::OutgoingWebhookEvent => Ok("outgoing_webhook_events_audit".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user