Skip to content

Template Insights: Top users list & session length to API #9497

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

Closed
4 tasks
bpmct opened this issue Sep 3, 2023 · 5 comments · Fixed by #10013
Closed
4 tasks

Template Insights: Top users list & session length to API #9497

bpmct opened this issue Sep 3, 2023 · 5 comments · Fixed by #10013
Assignees

Comments

@bpmct
Copy link
Member

bpmct commented Sep 3, 2023

Background

Our template insights page shows active users and latency per-developer. Latency is a useful metric for template admins as they can identify users who are having a sub-optimal experience. Once identified, the admin could deploy additional clusters, a workspace proxy, or work with the user to improve their networking setup.

While the latency metric is important, a far more common question we get from our users (and customers) is: "how can I tell if people are doing serious work with this template, versus just trying it one?"

In Coder v1, we exposed the session length per-developer in our Metrics UI and API. We already calculate this information in v2 for auto-stop (disconnect when there are no active sessions) as well as metrics UI (we show session length by IDE/app).

This issue refers to "session length" as "time in IDE," meaning the total duration the developer spent connecting over SSH, web terminal, and coder_apps (open websockets). These are all things that keep the workspace alive and prevent an auto-stop.

Product Requirements

Must Have

  • A template admin can use Coder's REST API to see session length per developer over a configurable time period. See how this works in our v1 API.

Should Have

  • We replace the default sidebar to show the template's top users instead of top user latency. Here's one idea that doesn't show each developers' session time:
    image

  • The template admin can still switch to see latency per user, or see it further down on the insights page

Nice to Have

A note on accuracy & feature vision

While this metric isn't perfect (an engineer can keep an IDE open while not actively using it), this rough approximation will still be miles ahead of what our product provides now in terms of usage metrics. Additionally, in large enterprises Coder is often used with endpoint protection tools (e.g. browser security tools or VDI clients) that prevent windows from being open for a long time for security reasons. Down the road, this data could be augmented by IDE plugins that are used to better determine activity, both for metrics and autostop.

We do not expect this information to be used to micro-manage (the platform admin/template admin is typically not the end user's manager). Instead, this information helps justify that Coder is being actively used, and for serious work, to the rest of the organization, including leadership/stakeholders. Since we can expect that Coder power-users will already use our API and Prometheus metrics for fine-grained data, we can only show a basic "at glance" visualization in the dashboard that demonstrates Coder's top users. I'm totally open to various charts/lists we show in the dashboard

@cdr-bot cdr-bot bot added the feature label Sep 3, 2023
@BrunoQuaresma
Copy link
Collaborator

I can think about a good design for it 👍

@BrunoQuaresma
Copy link
Collaborator

The most challenge part is the BE cc.: @mafredri

@mafredri
Copy link
Member

mafredri commented Sep 5, 2023

This is doable and I believe it's mostly a matter of adapting the query for "total app usage" insights.

We currently track session lengths for apps (code-server) and web terminal. We don't explicitly track session lengths over SSH (e.g. desktop apps), but the agent does report that there a N sessions active at any given time, this data should approximately give us what is described here.

A future improvement could be to track bandwidth utilization as well, session length x bandwidth (trickle over time) might give a deeper insight to actual usage. But this does get dangerously close to keeping tabs on individual developers.

@mtojek mtojek self-assigned this Sep 21, 2023
@mtojek
Copy link
Member

mtojek commented Sep 21, 2023

Let's see how far I can go here.

@mtojek
Copy link
Member

mtojek commented Sep 26, 2023

@BrunoQuaresma Backend is merged now, and we have /insights/user-activity. I believe that you can park it for frontend development.

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 a pull request may close this issue.

4 participants