Use insert_id as partition key for crash events (#28293)
Release Notes: - N/A
This commit is contained in:
parent
b306a0221b
commit
0dc3dffe38
1 changed files with 22 additions and 10 deletions
|
@ -161,16 +161,22 @@ pub async fn post_crash(
|
||||||
"description": description,
|
"description": description,
|
||||||
"backtrace": summary,
|
"backtrace": summary,
|
||||||
});
|
});
|
||||||
SnowflakeRow::new(
|
let row = SnowflakeRow::new(
|
||||||
"Crash Reported",
|
"Crash Reported",
|
||||||
None,
|
None,
|
||||||
false,
|
false,
|
||||||
Some(installation_id),
|
Some(installation_id),
|
||||||
properties,
|
properties,
|
||||||
)
|
);
|
||||||
.write(&Some(kinesis_client), &Some(stream))
|
let data = serde_json::to_vec(&row)?;
|
||||||
.await
|
kinesis_client
|
||||||
.log_err();
|
.put_record()
|
||||||
|
.stream_name(stream)
|
||||||
|
.partition_key(row.insert_id.unwrap_or_default())
|
||||||
|
.data(data.into())
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,16 +370,22 @@ pub async fn post_panic(
|
||||||
"description": panic.payload,
|
"description": panic.payload,
|
||||||
"backtrace": backtrace,
|
"backtrace": backtrace,
|
||||||
});
|
});
|
||||||
SnowflakeRow::new(
|
let row = SnowflakeRow::new(
|
||||||
"Panic Reported",
|
"Panic Reported",
|
||||||
None,
|
None,
|
||||||
false,
|
false,
|
||||||
panic.installation_id.clone(),
|
panic.installation_id.clone(),
|
||||||
properties,
|
properties,
|
||||||
)
|
);
|
||||||
.write(&Some(kinesis_client), &Some(stream))
|
let data = serde_json::to_vec(&row)?;
|
||||||
.await
|
kinesis_client
|
||||||
.log_err();
|
.put_record()
|
||||||
|
.stream_name(stream)
|
||||||
|
.partition_key(row.insert_id.unwrap_or_default())
|
||||||
|
.data(data.into())
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue