Skip to content

Conversation

@0xPoe
Copy link
Collaborator

@0xPoe 0xPoe commented Jul 4, 2024

close #551

This PR added a new field to the console's update message. Clients can use it to check if the subscriber stream is paused.

For example:
image

@0xPoe 0xPoe force-pushed the rustin-patch-state branch 3 times, most recently from 42f9bc6 to 73331fd Compare July 5, 2024 13:26
@0xPoe 0xPoe marked this pull request as ready for review July 5, 2024 13:27
@0xPoe 0xPoe requested a review from a team as a code owner July 5, 2024 13:27
@0xPoe 0xPoe force-pushed the rustin-patch-state branch from 73331fd to 705f0bb Compare July 5, 2024 13:31
Copy link
Collaborator Author

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a perfect solution to fully solve this problem.

It can only be used before the new client starts, for already running clients, it doesn't help, because there is no message sent to that second client.

@0xPoe 0xPoe requested a review from hds July 5, 2024 13:39
@0xPoe 0xPoe force-pushed the rustin-patch-state branch from 705f0bb to 68064d6 Compare July 5, 2024 13:49
@0xPoe 0xPoe changed the title feat: add temporality state in update feat: add temporality state to update message Jul 5, 2024
@0xPoe 0xPoe requested a review from hawkw July 6, 2024 02:07
This field can be used to check if the stream has been paused.
@0xPoe 0xPoe force-pushed the rustin-patch-state branch from 68064d6 to 5f847ec Compare July 22, 2024 10:44
Copy link
Collaborator

@hds hds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that putting the pause/live state into a separate update stream would make it flexible enough to update all clients that the subscriber is paused.

warnings::Linter,
};
use console_api as proto;
use console_api::instrument::Temporality;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all other items used from the console_api crate, we reference by the "full" path (but starting with proto), I think we should do the same here to not make Temporality different.

Suggested change
use console_api::instrument::Temporality;

current_view: &view::ViewState,
update: proto::instrument::Update,
) {
match Temporality::try_from(update.temporality) {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 console_api crate.

Suggested change
match Temporality::try_from(update.temporality) {
match proto::instrument::Temporality::try_from(update.temporality) {

}

// The time "state" of the aggregator.
enum Temporality {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@0xPoe
Copy link
Collaborator Author

0xPoe commented Sep 2, 2024

Finally, I have some time to work on it again. I will try to add a new API for it.

@0xPoe 0xPoe closed this in #582 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tokio-console cannot show the pause status correctly

2 participants