Skip to content

Usage report breakdown by user does not properly group users #46

Open
@choldgraf

Description

@choldgraf

Bug description

The Grafana report that breaks down RAM by user does not properly group all of the users.

We think that this is because of the following dashboard code:

// Computes sum of pod memory requests, grouped by username, for notebook pods
prometheus.target(
|||
kube_pod_labels{
label_app="jupyterhub",
label_component="singleuser-server",
namespace=~"$hub"
}
* on (namespace, pod) group_left()
sum(
container_memory_working_set_bytes{
namespace=~"$hub",
container="notebook",
hub_jupyter_org_node_purpose="user",
name!="",
}
) by (namespace, pod)
|||,
legendFormat='{{label_hub_jupyter_org_username}} ({{namespace}})',

From a conversation @GeorgianaElena noted:

Notice the group_left in the query which generated some duplicated entries in the graph, even though we were up to get the sum over each pod.
I've changed the group_left to a group_right and that generated the graph I shared in the previous message which looked like it produced a single value for the mem used by each notebook pod.

Expected behaviour

There should be a single plot per user, not multiple plots per user.

Actual behaviour

image

How to reproduce

  • Go to the Usage report dashboard in the Grafana
  • This should show multiple plots per user

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions