-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: telemetry service #1243
base: main
Are you sure you want to change the base?
feat: telemetry service #1243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK - Would need the BETA env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the telemetry address to CI.
src-tauri/src/main.rs
Outdated
let telemetry_service = state.telemetry_service.clone(); | ||
let telemetry_service = telemetry_service.read().await; | ||
let telemetry_service = telemetry_service.deref(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting. We can't just clone it, or borrow it. We have to deref it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's unnecessary, we can just use &
to get reference to rw lock guard.
@@ -265,6 +309,17 @@ async fn setup_inner( | |||
sleep(Duration::from_secs(1)); | |||
} | |||
|
|||
drop( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to drop after each call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler complains if we ignore result of sending telemetry data. This workaround another possibility could be to write let _ = ...
src-tauri/src/telemetry_service.rs
Outdated
let hardware = HardwareStatusMonitor::current(); | ||
let cpu_name = hardware.get_cpu_devices().await?; | ||
let cpu_name = match cpu_name.first() { | ||
Some(cpu) => cpu.public_properties.name.clone(), | ||
None => "Unknown".to_string(), | ||
}; | ||
let gpu_name = hardware.get_gpu_devices().await?; | ||
let gpu_name = match gpu_name.first() { | ||
Some(gpu) => gpu.public_properties.name.clone(), | ||
None => "Unknown".to_string(), | ||
}; | ||
let os = PlatformUtils::detect_current_os(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it heavy to re-request this data constantly?
Most of this won't change. Could we get it once during initialization and cache it for each request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, moved it to initialization.
fdb9b19
to
7c5994c
Compare
Description
Resolves #1186
Add new telemetry service which receives events and immediately sends them.
example event sent:
Motivation and Context
This should be useful for tracking how many users are stuck during application setup. We saw some users being stuck at 30% with now feedback. This should help in debugging issues like that.
How Has This Been Tested?
Run application and watch for error message coming from telemetry service. If no error are present that means that events were sent correctly. Also check the telemetry dashboard to check if any messages are present on the server.
To verify frontend command I created test button to invoke like this:
And found those event present in the kafka dashboard:
What process can a PR reviewer use to test or verify this change?
Same as above.
Breaking Changes