{"id":20198575,"url":"https://github.com/eclipsesource/theia-cloud-observability","last_synced_at":"2026-01-05T04:03:18.408Z","repository":{"id":252222782,"uuid":"839779029","full_name":"eclipsesource/theia-cloud-observability","owner":"eclipsesource","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-04T08:50:57.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-14T04:34:58.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eclipsesource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T10:00:13.000Z","updated_at":"2024-09-04T08:51:01.000Z","dependencies_parsed_at":"2024-08-08T13:00:24.483Z","dependency_job_id":"dc182666-af10-4603-94c1-49c758393a18","html_url":"https://github.com/eclipsesource/theia-cloud-observability","commit_stats":null,"previous_names":["eclipsesource/theia-cloud-observability"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftheia-cloud-observability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftheia-cloud-observability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftheia-cloud-observability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftheia-cloud-observability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipsesource","download_url":"https://codeload.github.com/eclipsesource/theia-cloud-observability/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233802416,"owners_count":18732534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:32:22.218Z","updated_at":"2025-09-21T21:32:23.903Z","avatar_url":"https://github.com/eclipsesource.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theia Cloud Observability\n\n[![Aim - Demo](https://img.shields.io/badge/Aim-Demo-cfc53c)](https://github.com/eclipsesource/.github/blob/main/repository-classification.md)\n\nThis repository contains an experimental, initial setup to monitor a Theia Cloud deployment using [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/grafana/).\n\nThe important part of this is the configuration in folders [`kube-prometheus-stack`](./kube-prometheus-stack/) and [`grafana-dashboards`](./grafana-dashboards).\n\n## Subfolders\n\n- `grafana-dashboards`: JSON models of custom Grafana dashboards\n- `kube-prometheus-stack`: Configuration and documentation for the Prometheus stack\n- `metrics-client`: Example Typescript app to process Prometheus metrics via HTTP REST API\n\n## Setup\n\n1. If not already done: Setup Theia Cloud  on your Kubernetes cluster. See the [official documentation](https://theia-cloud.io/documentation/setuptheiacloud/).\n2. Install the Prometheus stack by following the subfolder's [README](./kube-prometheus-stack/README.md)\n3. Especially if you expose Grafana publicly, make sure to change the admin password ASAP.\n\n## Grafana\n\nIf you exposed Prometheus via an Ingress, access the web ui via the configured domain.\nOtherwise, you can use `kubectl` to expose it at \u003chttp://localhost:3333\u003e.\n\n```sh\nkubectl port-forward svc/kube-prometheus-stack-grafana 3333:80 -n kube-prometheus-stack\n```\n\nThe default admin account credentials are `admin:prom-operator`.\nExcept if you configured another admin password in the values.\n\nTo find the pre-defined Theia Cloud dashboard containing metrics on cluster, node, pod and Theia backend level, click on `Dashboards` in the menu on the left.\nScroll down or search to find the `Theia Cloud` dashboard.\n\n## Try Prometheus queries directly\n\nIf you exposed Prometheus via an Ingress, access the web ui via the configured domain.\nOtherwise, you can use `kubectl` to expose it at \u003chttp://localhost:9090\u003e.\n\n```sh\nkubectl port-forward svc/kube-prometheus-stack-prometheus 9090:9090 -n kube-prometheus-stack\n```\n\nBesides using the Web UI, metrics can also be queries via a REST API.\nSee the [Prometheus docs](https://prometheus.io/docs/prometheus/latest/querying/api/) on this and check the minimal example in the [metrics-client](./metrics-client/) folder.\n\n### Prometheus queries\n\nThis section lists [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/) queries for Prometheus to get metrics for CPU and RAM on a cluster, node, pod, and Theia level.\n\nNote that some of the queries assume that Theia Cloud was installed in namespace `theiacloud`.\nIf this is not the case, the corresponding selector `{namespace=\"theiacloud\"}` needs to be adapted in the queries.\n\n#### Cluster\n\nMetrics for the whole cluster.\n\n```\n# CPU: Ratio of used cpus to total cpus available in the cluster\ncluster:node_cpu:ratio\n\n# CPU: Number of CPUs used in the cluster. Using 1 cpu does not mean that exactly one (virtual) core was fully used but that the equivalent was used - even if actually distributed about different cores.\n# Calculated based on the increase of total cpu time in the last 5 minutes\ncluster:node_cpu:sum_rate5m\n\n# Memory: Calculates the ratio of used memory across all nodes\n1 - sum(node_memory_MemAvailable_bytes) / sum(node_memory_MemTotal_bytes)\n\n# Memory: The total amount of memory across all nodes\nsum(node_memory_MemTotal_bytes)\n\n# Memory: The used memory across all nodes\nsum(node_memory_MemTotal_bytes) - sum(node_memory_MemAvailable_bytes)\n```\n\n#### Node\n\nMetrics collected per node of the cluster.\n\n```\n# CPU: Usage ratio per node\ninstance:node_cpu:ratio\n\n# CPU: Usage in virtual CPUs per node\ninstance:node_cpu:rate:sum\n\n# Memory: Usage per node\nnode_memory_MemTotal_bytes - node_memory_MemAvailable_bytes\n\n# Memory: Usage ratio per node\n1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes\n```\n\n#### Pod\n\nMetrics per (session) pod. This means the whole pod, not only the Theia container in the pod. For many applications this will be nearly identical to the metrics for the Theia container only.\nHowever, for applications using sidecar containers besides the Theia container, this provides information considering these, too.\n\n```\n# Memory used by pods in the theiacloud namespace. Could filter further to only get session pods.\n# Filter out empty container time series because this leads to duplicate results.\n# Make sure to only read the metrics as exposed by the kubelet by specifying the job and metrics_path labels accordingly\nsum(container_memory_usage_bytes{container!=\"POD\",container!=\"\", job=\"kubelet\", metrics_path=\"/metrics/cadvisor\",namespace=\"theiacloud\"}) by (pod)\n\n# CPU used by pods in the theiacloud namespace. Could filter further to only get session pods\n# Filter job and metrics_path as for memory (same as for memory)\nsum(rate(container_cpu_usage_seconds_total{container!=\"POD\",container!=\"\", job=\"kubelet\", metrics_path=\"/metrics/cadvisor\", namespace=\"theiacloud\"}[5m])) by (pod)\n\n# Number of running session pods\ncount(up{job=\"kube-prometheus-stack/theiacloud-sessions\"})\n```\n\n#### Theia Backend\n\nMetrics for the Theia application container based on metrics directly exposed by Theia's metrics extension.\nThis requires the `@theia/metrics` extension to be installed in the application.\nThis is the case for Theia IDE and the Theia Cloud example application.\n\n```\n# CPU used by the process. Might need further filtering if there are additional services in the Theia Cloud namespace. A value of 1 means the process uses 1 vCPU.\nrate(process_cpu_seconds_total{namespace=\"theiacloud\"}[1m])\n\n# Virtual memory consumed by the process. This includes all memory including swapped out memory and, thus, indicates the total memory consumption of the process\nprocess_virtual_memory_bytes{namespace=”theiacloud”, job=\"kube-prometheus-stack/theiacloud-sessions\"}\n\n# Process start time\n# Stop time cannot be exposed as a metric. It can be determined by checking when this or another timeline for the session ends.\nprocess_start_time_seconds{namespace=\"theiacloud\"}\n```\n\n## Repository Classification\n\nThis repository contains a demonstrator. It is used to demonstrate a specific feature on a documented demo path. It is not meant to be used in production or as a template. Consequently, the authors do not actively ensure that anything other than the demo path works and don’t plan to support different set-ups or environments. Until stated otherwise, the authors do not intend to apply security fixes, update dependencies, fix issues or provide more documentation. Please feel free to browse the code although it is not meant as a blueprint, i.e. there might be expected and undocumented architectural shortcomings or work around.\nPlease feel free to report issues, ask questions and raise discussions, but please don’t expect the authors to provide support.\n\nIf you are interested in transforming this demonstrator into an adoptable state, please get in contact with us using the [discussions forum](https://github.com/eclipsesource/theia-cloud-observability/discussions) and have a look at our [support options](https://eclipsesource.com/services)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipsesource%2Ftheia-cloud-observability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipsesource%2Ftheia-cloud-observability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipsesource%2Ftheia-cloud-observability/lists"}