{"record":{"id":"a8f9542571b0e5ee","repo":"juspay/hyperswitch","slug":"couldn-t-get-getsdkeventmetricrequest","errorCode":null,"errorMessage":"Couldn't get GetSdkEventMetricRequest","messagePattern":"Couldn't get GetSdkEventMetricRequest","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router/src/analytics.rs","lineNumber":1164,"sourceCode":"        .await\n    }\n\n    #[cfg(feature = \"v1\")]\n    /// # Panics\n    ///\n    /// Panics if `json_payload` array does not contain one `GetSdkEventMetricRequest` element.\n    pub async fn get_sdk_event_metrics(\n        state: web::Data<AppState>,\n        req: actix_web::HttpRequest,\n        json_payload: web::Json<[GetSdkEventMetricRequest; 1]>,\n    ) -> impl Responder {\n        // safety: This shouldn't panic owing to the data type\n        #[allow(clippy::expect_used)]\n        let payload = json_payload\n            .into_inner()\n            .to_vec()\n            .pop()\n            .expect(\"Couldn't get GetSdkEventMetricRequest\");\n        let flow = AnalyticsFlow::GetSdkMetrics;\n        Box::pin(api::server_wrap(\n            flow,\n            state,\n            &req,\n            payload,\n            |state, auth: AuthenticationData, req, _| async move {\n                analytics::sdk_events::get_metrics(\n                    &state.pool,\n                    &auth.platform.get_processor().get_account().publishable_key,\n                    req,\n                )\n                .await\n                .map(ApplicationResponse::Json)\n            },\n            &auth::JWTAuth {\n                permission: Permission::MerchantAnalyticsRead,\n                allow_connected: true,","sourceCodeStart":1146,"sourceCodeEnd":1182,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/router/src/analytics.rs#L1146-L1182","documentation":"Error \"Couldn't get GetSdkEventMetricRequest\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router/src/analytics.rs:1164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the analytics metrics feature is enabled and the request type is supported by the analytics provider","Verify the metrics request construction parameters (merchant id, time range, filters)"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"705a3219504c3cf9034e71d956455f8834ea4e64","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}