Skip to main content
Version: 1.51

Okteto Insights Metrics

Okteto Insights exposes a metrics endpoint that you can scrape to collect data on resource usage, builds, and deployments. The data comes from developer activity on the platform: product usage, infrastructure utilization, and performance. Use it to monitor the health of your Okteto cluster, track trends in build and deploy times, and measure user activity.

info

On Bring Your Own Cloud (BYOC), Okteto Insights comes with preconfigured Grafana dashboards. Okteto Insights Dashboards explains how to open them and what they show. Use this page only if you want another tool to read the Insights data.

The activity dashboard of Okteto Insights

Consuming Okteto Insights Data​

Okteto Insights serves its data on an endpoint that tools such as Prometheus can scrape, so Admins can consume it programmatically. To set it up, enable Insights, get your bearer token, and deploy the open-source Insights Dashboards to visualize your Okteto data.

Enabling the Metrics Endpoint​

Okteto Insights is disabled by default on Self-Hosted instances. To enable it, set the Helm setting insights.enabled to true and upgrade your Okteto instance.

Okteto then serves the data in Prometheus format at https://okteto.SUBDOMAIN/metrics. A bearer token that Okteto generates protects the endpoint. To use your own token instead, store it in the secret that the insights Helm setting defines.

Retrieving Your Bearer Token​

In the Admin Dashboard, Admin > Integrations > General has your Insights bearer token. Click Show Insights Token in the Insights row to see it and copy it.

Setting Up the Dashboards​

To collect and visualize Insights data, start from the Okteto Insights Dashboards repository. It includes setups to deploy Prometheus and Grafana, and sample dashboards.

To configure it yourself, set up a scraper that connects to the endpoint with your bearer token. For example, this Prometheus scrape configuration:

- job_name: "okteto_scraper"
scrape_interval: 5m
scrape_timeout: 30s

scheme: https
static_configs:
- targets: ["okteto.SUBDOMAIN:443"] # replace SUBDOMAIN with your Okteto subdomain
authorization:
type: Bearer
credentials: <bearer-token> # replace <bearer-token> with the token generated by Okteto
caution

Okteto Self-Hosted doesn't include a Prometheus instance or storage for this data. Deploy your own Prometheus instance, or another data collection platform, to consume the data and manage counters and metrics with Prometheus' built-in features.

The Okteto Insights Dashboards repository includes a Prometheus configuration to start from.

What data is available​

Okteto Insights has these groups of metrics:

note

Every metric that Okteto provides has the okteto_ prefix.

Okteto adds metrics to this endpoint over time. These are the metrics available today:

Build Metrics​

note

Only successful builds are tracked with okteto_usage_build_duration_seconds.

Metric NameTypeDescriptionLabels
okteto_usage_build_duration_secondshistogramTime to build each image that Okteto builds. It only reflects successful builds.devenv_name, image_name, namespace, repository
okteto_usage_build_resultcounterResult of each image build in Okteto.devenv_name, image_name, namespace, repository, result
  • Build Metrics label definitions:
    • devenv_name: The name of the deployed application environment that the build belongs to, if any
    • image_name: The name of the image, as it appears in the Okteto Manifest
    • namespace: The Okteto CLI context that the request came from
    • repository: The Git repository that hosts the Okteto Manifest that defines the image
    • result: The status of the build: success, failure, or skipped

Deploy Metrics​

note

Only successful deployments are tracked with okteto_usage_deploy_duration_seconds.

Metric NameTypeDescriptionLabels
okteto_usage_deploy_duration_secondshistogramTime to deploy an application environment. It only reflects successful deployments.devenv_name, namespace, repository, phase
okteto_usage_deploy_resultcounterResult of each deployment of an application environment.devenv_name, namespace, repository, result
  • Deploy Metrics label definitions:
    • devenv_name: The name of the deployed application environment
    • namespace: The Okteto CLI context that the request came from
    • repository: The Git repository that hosts the Okteto Manifest that defines the application environment
    • phase: The phase of the deployment that the time series measures: compose for the Compose section or commands for the Commands section of the Okteto Manifest's deploy section. The sum of both time series is the total length of a deployment.
    • result: The status of the deployment: success or failure

Namespace Metrics​

Metric NameTypeDescriptionLabels
okteto_system_namespace_status_conditiongaugeStatus of a Namespace. It doesn't include the Namespaces of Preview Environments.namespace, condition, owner_id
okteto_system_namespace_created_timegaugeCreation time of a Namespace.namespace, owner_id
  • Namespace Metrics label definitions:
    • namespace: The name of the Namespace
    • condition: The condition of the Namespace: active or sleeping
    • owner_id: The ID of the Namespace's owner

Node Metrics​

Metric NameTypeDescriptionLabels
okteto_system_nodegaugeNumber of nodes that run Okteto.none
okteto_system_node_memory_bytesgaugeTotal memory (in bytes) that a node can allocate.node_name
okteto_system_node_memory_requested_bytesgaugeTotal memory (in bytes) requested on a node.node_name
okteto_system_node_memory_usage_bytesgaugeTotal memory (in bytes) in use on a node.node_name
okteto_system_node_cpu_coresgaugeTotal CPU cores that a node can allocate.node_name
okteto_system_node_cpu_requested_coresgaugeTotal CPU cores requested on a node.node_name
okteto_system_node_cpu_usage_coresgaugeTotal CPU cores in use on a node.node_name
  • Node Metrics label definitions:
    • node_name: The name of the node

Pod Metrics​

Metric NameTypeDescriptionLabels
okteto_system_pod_container_cpu_requests_coresgaugeCPU requested for a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_container_cpu_limits_coresgaugeCPU limits of a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_init_container_cpu_requests_coresgaugeCPU requests of an init container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_init_container_cpu_limits_coresgaugeCPU limits of an init container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_container_cpu_usage_coresgaugeCPU usage of a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_container_memory_requests_bytesgaugeMemory requested for a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_container_memory_limits_bytesgaugeMemory limits of a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_init_container_memory_requests_bytesgaugeMemory requested for an init container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_init_container_memory_limits_bytesgaugeMemory limits of an init container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
okteto_system_pod_container_memory_usage_bytesgaugeMemory usage of a standard container of a pod, at that point in time.container_name, pod_name, namespace, node_name, devenv_name, pod_type, controller_type, controller_name
  • Pod Metrics label definitions:
    • container_name: The name of the container
    • pod_name: The name of the pod
    • namespace: The name of the Namespace
    • node_name: The name of the node
    • devenv_name: The name of the deployed application environment that the pod belongs to, if any
    • pod_type: Whether the pod is in development mode: development or standard
    • controller_type: The type of the top controller that created the pod: deployment or statefulset
    • controller_name: The name of the top controller that created the pod

Preview Metrics​

Metric NameTypeDescriptionLabels
okteto_system_preview_status_conditiongaugeStatus of a Preview Environment.namespace, condition, scope, owner_id
okteto_system_preview_created_timegaugeCreation time of a Preview Environment.namespace, scope, owner_id
  • Preview Metrics label definitions:
    • namespace: The name of the Namespace
    • condition: The condition of the Preview Environment: active or sleeping
    • scope: The scope of the Preview Environment: personal or global
    • owner_id: The ID of the Preview Environment's owner

Test Metrics​

note

Only successful tests are tracked with okteto_usage_test_duration_seconds.

Metric NameTypeDescriptionLabels
okteto_usage_test_duration_secondshistogramTime to run a test. It only reflects successful tests.devenv_name, namespace, repository, test_name
okteto_usage_test_resultcounterResult of each test of an application environment.devenv_name, namespace, repository, test_name, result
  • Test Metrics label definitions:
    • devenv_name: The name of the application environment
    • namespace: The Okteto CLI context that the request came from
    • repository: The Git repository that hosts the Okteto Manifest that defines the application environment
    • test_name: The name of the test
    • result: The status of the test: success or failure

User Metrics​

Metric NameTypeDescriptionLabels
okteto_system_user_last_seen_timegaugeTime of a user's last activity.id, external_id, role
  • User Metrics label definitions:
    • id: The user's ID
    • external_id: The user's external ID
    • role: The user's role

Troubleshooting​

Metrics Server Availability​

Okteto Insights relies on the Kubernetes Metrics Server. If the Metrics Server is unavailable, requests to the /metrics endpoint fail, including the requests from a configured scraper. See the Metrics Server documentation to troubleshoot it.