-
-
Notifications
You must be signed in to change notification settings - Fork 142
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: add temporality state to update message #567
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ use crate::{ | |||||
warnings::Linter, | ||||||
}; | ||||||
use console_api as proto; | ||||||
use console_api::instrument::Temporality; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For all other items used from the
Suggested change
|
||||||
use ratatui::{ | ||||||
style::{Color, Modifier}, | ||||||
text::Span, | ||||||
|
@@ -71,12 +72,6 @@ pub(crate) enum FieldValue { | |||||
Debug(String), | ||||||
} | ||||||
|
||||||
#[derive(Debug)] | ||||||
enum Temporality { | ||||||
Live, | ||||||
Paused, | ||||||
} | ||||||
|
||||||
#[derive(Debug, Eq, PartialEq)] | ||||||
pub(crate) struct Attribute { | ||||||
field: Field, | ||||||
|
@@ -107,6 +102,14 @@ impl State { | |||||
current_view: &view::ViewState, | ||||||
update: proto::instrument::Update, | ||||||
) { | ||||||
match Temporality::try_from(update.temporality) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps best to stick to the way that we reference all other types from the
Suggested change
|
||||||
Ok(temporality) => { | ||||||
self.temporality = temporality; | ||||||
} | ||||||
Err(..) => { | ||||||
tracing::warn!(?update.temporality, "invalid temporality"); | ||||||
} | ||||||
} | ||||||
if let Some(now) = update.now.map(|v| v.try_into().unwrap()) { | ||||||
self.last_updated_at = Some(now); | ||||||
} | ||||||
|
@@ -250,12 +253,6 @@ impl State { | |||||
} | ||||||
} | ||||||
|
||||||
impl Default for Temporality { | ||||||
fn default() -> Self { | ||||||
Self::Live | ||||||
} | ||||||
} | ||||||
|
||||||
impl Metadata { | ||||||
fn from_proto(pb: proto::Metadata, id: u64, strings: &mut intern::Strings) -> Self { | ||||||
Self { | ||||||
|
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 think it would make sense to add another
rpc
for console subscriber state updates. Right now temporality would be the only thing in there, but this would allow us to do "out of band" state updates such as this case, where no data is being sent.This would also allow us to solve the issue with already connected clients, as we could send this new server state update without needing to send a real update, so all connected tokio console instances would get the pause update.
What do you think?
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.
Sounds good! It would be a good solution.