Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Architecture

This document outlines the architecture of the project, including its dependencies, their interactions, and the overall design principles.

Overview

This architecture diagram outlines how the cost monitoring infrastructure sits in the wider Zero to JupyterHub deployment, which is divided into two main namespaces: Support and Hub, as well as the external AWS service.

The Support section is where the JupyterHub Cost Monitoring backend is deployed. This backend retrieves cost data from the AWS Cost Explorer API. Usage data is collected by a Prometheus server from various exporters, including kube-state-metrics, node_exporter, and a jupyterhub-groups-exporter. Prometheus stores metrics in an internal time series database which can be queried with PromQL and exposes to Grafana for visualization.

The Hub section represents the user-facing JupyterHub components where users can connect via a proxy to the JupyterHub instance. JupyterHub manages User Pods and stores state, such as users, groups, server sessions, in a dedicated database. The jupyterhub-groups-exporter extracts group-related information from JupyterHub and sends it to Prometheus.

Cost Monitoring

Cost data is exposed with jupyterhub-cost-monitoring via FastAPI that can be consumed by other applications in the cluster, such as Grafana. The following endpoints are available:

Reference documentation is available at the /docs FastAPI endpoint.