Skip to content

Commit 9c34c48

Browse files
danielsnanais-raison
authored andcommitted
[crashtracker] Don't send the same stack trace twice (#1005)
1 parent 823ec7c commit 9c34c48

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

datadog-crashtracker/src/crash_info/telemetry.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ impl TelemetryCrashUploader {
108108

109109
let message = serde_json::to_string(crash_info)?;
110110

111-
let stack_trace = serde_json::to_string(&crash_info.error.stack)?;
112111
let tags = extract_crash_info_tags(crash_info).unwrap_or_default();
113112

114113
let tracer_time = crash_info.timestamp.parse::<DateTime<Utc>>().map_or_else(
@@ -131,7 +130,8 @@ impl TelemetryCrashUploader {
131130
payload: &data::Payload::Logs(vec![data::Log {
132131
message,
133132
level: LogLevel::Error,
134-
stack_trace: Some(stack_trace),
133+
// The stacktrace is already included in the `crash_info` inside `message`.
134+
stack_trace: None,
135135
tags,
136136
is_sensitive: true,
137137
count: 1,
@@ -211,7 +211,7 @@ fn extract_crash_info_tags(crash_info: &CrashInfo) -> anyhow::Result<String> {
211211
#[cfg(test)]
212212
mod tests {
213213
use super::TelemetryCrashUploader;
214-
use crate::crash_info::{test_utils::TestInstance, CrashInfo, Metadata, StackTrace};
214+
use crate::crash_info::{test_utils::TestInstance, CrashInfo, Metadata};
215215
use ddcommon::Endpoint;
216216
use std::{collections::HashSet, fs};
217217

@@ -293,9 +293,6 @@ mod tests {
293293
);
294294
assert_eq!(payload["payload"][0]["is_sensitive"], true);
295295
assert_eq!(payload["payload"][0]["level"], "ERROR");
296-
let stack_trace: StackTrace =
297-
serde_json::from_str(payload["payload"][0]["stack_trace"].as_str().unwrap())?;
298-
assert_eq!(stack_trace, test_instance.error.stack);
299296
let body: CrashInfo =
300297
serde_json::from_str(payload["payload"][0]["message"].as_str().unwrap())?;
301298
assert_eq!(body, test_instance);

0 commit comments

Comments
 (0)