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

Changes to send response in the fireboltInteraction logs #560

Merged
merged 7 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/main/src/firebolt/rpc_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl RpcRouter {

Self::log_rdk_telemetry_message(&app_id, &method, status_code, now - start);

TelemetryBuilder::send_fb_tt(&state, req.clone(), now - start, success);
TelemetryBuilder::send_fb_tt(&state, req.clone(), now - start, success, &msg);

return_api_message_for_transport(session, msg, state).await;
}
Expand Down
2 changes: 1 addition & 1 deletion core/main/src/processor/metrics_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl ExtnRequestProcessor for OpMetricsProcessor {
.operational_telemetry_listener(&requestor, true),
OperationalMetricRequest::UnSubscribe => state
.metrics
.operational_telemetry_listener(&requestor, true),
.operational_telemetry_listener(&requestor, false),
Copy link
Contributor

Choose a reason for hiding this comment

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

Bugfix, bonus!

_ => (),
}
Self::ack(state.get_client().get_extn_client(), msg)
Expand Down
12 changes: 10 additions & 2 deletions core/main/src/service/telemetry_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use ripple_sdk::{
TelemetrySystemError,
},
},
gateway::rpc_gateway_api::{CallContext, RpcRequest},
gateway::rpc_gateway_api::{ApiMessage, CallContext, RpcRequest},
},
chrono::{DateTime, Utc},
extn::client::extn_client::ExtnClient,
Expand Down Expand Up @@ -181,7 +181,13 @@ impl TelemetryBuilder {
}
}

pub fn send_fb_tt(ps: &PlatformState, req: RpcRequest, tt: i64, success: bool) {
pub fn send_fb_tt(
ps: &PlatformState,
req: RpcRequest,
tt: i64,
success: bool,
resp: &ApiMessage,
) {
let ctx = req.ctx;
let method = req.method;
let params = if let Ok(mut p) = serde_json::from_str::<Vec<Value>>(&req.params_json) {
Expand All @@ -195,6 +201,7 @@ impl TelemetryBuilder {
} else {
None
};
let response = serde_json::to_string(resp).unwrap_or_default();
if let Err(e) = Self::send_telemetry(
ps,
TelemetryPayload::FireboltInteraction(FireboltInteraction {
Expand All @@ -205,6 +212,7 @@ impl TelemetryBuilder {
method,
params,
success,
response,
}),
) {
error!("send_telemetry={:?}", e)
Expand Down
1 change: 1 addition & 0 deletions core/sdk/src/api/firebolt/fb_telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pub struct FireboltInteraction {
pub success: bool,
pub ripple_session_id: String,
pub app_session_id: Option<String>,
pub response: String,
}

#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
Expand Down
Loading