Skip to content

Commit

Permalink
Analytics: Rename "location" to "file_line" in the "crash-panic" event (
Browse files Browse the repository at this point in the history
#1575)

* Analytics: Rename "location" to "file_line" in the "crash-panic" event

* debug-assert that we don't use the same name
  • Loading branch information
emilk committed Mar 13, 2023
1 parent dea09f7 commit 94363a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion crates/re_analytics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,20 @@ impl Event {
}
}

/// NOTE: due to an earlier snafu, we filter out all properties called
/// `git_branch` and `location` on the server-end, so don't use those property names!
/// See <https://github.com/rerun-io/rerun/pull/1563> for details.
pub fn with_prop(
mut self,
name: impl Into<Cow<'static, str>>,
value: impl Into<Property>,
) -> Self {
self.props.insert(name.into(), value.into());
let name = name.into();
debug_assert!(
name != "git_branch" && name != "location",
"We filter out the property name {name:?} on the server-end. Pick a different name."
);
self.props.insert(name, value.into());
self
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rerun/src/crash_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn install_panic_hook(build_info: BuildInfo) {
if let Some(location) = panic_info.location() {
let file =
anonymize_source_file_path(&std::path::PathBuf::from(location.file()));
event = event.with_prop("location", format!("{file}:{}", location.line()));
event = event.with_prop("file_line", format!("{file}:{}", location.line()));
}

analytics.record(event);
Expand Down

0 comments on commit 94363a3

Please sign in to comment.