Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: zero out session stats from agent with experiment enabled#13579

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
f0ssel wants to merge14 commits intomainfromf0ssel/agent-stats-experiment

Conversation

f0ssel
Copy link
Contributor

@f0sself0ssel commentedJun 14, 2024
edited
Loading

This moves the responsibility for reporting ssh session stats from the agent to the cli ssh command.

  • agentapi - Adds newGetExperiments endpoint so agents can query active experiments. AgentAPI Version bumped to2.2.
  • agent - Now queries experiments before starting stats report loop. Ifworkspace_usage experiment is enabled we will zero out SSH session stats before sending it to coderd.
  • cli - Connecting to a new SSH session will now regularly push to workspace usage endpoint, which will write ssh session stats if the experiment is enabled.

@f0sself0ssel marked this pull request as draftJune 14, 2024 20:03
@f0sself0ssel changed the titlechore: stop saving session stats with experimentchore: stop saving session stats with experiment + ssh usage trackingJun 17, 2024
@f0sself0ssel marked this pull request as ready for reviewJune 18, 2024 17:08
@f0sself0ssel changed the titlechore: stop saving session stats with experiment + ssh usage trackingchore: move ssh session tracking from agent to cliJun 18, 2024
Comment on lines +126 to +127
// if the experiment is enabled we zero out certain session stats
// as we migrate to the client reporting these stats instead.
Copy link
Member

Choose a reason for hiding this comment

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

Can this get implemented serverside instead? It seems like a lot of changes in the agent for something that could be zeroed out in the stats API on the server.

Copy link
Member

Choose a reason for hiding this comment

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

+1, this would keep the change in 'one place' and remove the need for plumbing this through AgentAPI

Copy link
ContributorAuthor

@f0sself0sselJun 20, 2024
edited
Loading

Choose a reason for hiding this comment

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

Not really and here's why - If customers update coder but do not rebuild the workspace, we will have an old agent client and old cli version in the workspace. If the experiment is enabled and we zero out the value server side, we will lose data for that workspace because the old cli will not be reporting the new data via the usage endpoint. So the graphs will go to zero and slowly come back up over time as each workspace is restarted.

So we need the endpoint to still save this data for old workspaces, but also allow new workspaces to report it in the new way. Or we accept downtime on the stats on upgrade until all workspaces are updated. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

If the experiment is enabled and we zero out the value server side, we will lose data for that workspace because the old cli will not be reporting the new data via the usage endpoint.

Won't the same thing happen even if the feature was GA? Old agent/CLI versions need to be supported on new servers for multiple months.

This will also affect stats collection for older CLIs being used outside of workspaces, which arguably is where more people use the CLI anyways. I don't think anyone is using the CLI in a workspace to connect to a workspace.

So we need the endpoint to still save this data for old workspaces, but also allow new workspaces to report it in the new way. Or we accept downtime on the stats on upgrade until all workspaces are updated.

I think either way there will be a "downtime" of stats with or without the agent changes when an older CLI is being used on the local machine.

I think this PR should change into just the CLI stats upload portion and have both sides report stats for now. Then in a few months you can remove stats reporting from the API by deprecating the field and ignoring it serverside.

Comment on lines +126 to +127
// if the experiment is enabled we zero out certain session stats
// as we migrate to the client reporting these stats instead.
Copy link
Member

Choose a reason for hiding this comment

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

+1, this would keep the change in 'one place' and remove the need for plumbing this through AgentAPI

@f0sself0ssel changed the titlechore: move ssh session tracking from agent to clichore: zero out session stats from agent with experiment enabledJun 22, 2024
@f0ssel
Copy link
ContributorAuthor

f0ssel commentedJun 22, 2024
edited
Loading

Closing due to release rollout issues in favor of#13635

@f0sself0ssel closed thisJun 22, 2024
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 22, 2024
@github-actionsgithub-actionsbot deleted the f0ssel/agent-stats-experiment branchDecember 21, 2024 00:05
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@johnstcnjohnstcnjohnstcn left review comments

@deansheatherdeansheatherdeansheather left review comments

Assignees

@f0sself0ssel

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@f0ssel@johnstcn@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp