Skip to content

Display performance graphs on Environments detail page for specific metrics

Resources

UX @tauriedavis

Description

With Prometheus able to easily monitor Kubernetes based deployments, we can surface the performance and health information we have available for a given Environment on its detail page.

Proposal

We should start with two key metrics which Kubernetes is able to monitor for: container_cpu_usage_seconds_total and container_memory_usage_bytes. Screen_Shot_2017-01-19_at_10.03.02_PM

Retrieving the correct metric for a given GitLab CI auto-deployed environment is straightforward, as it deploys in a consistent way:

  • The Kubernetes namespace is the project name.
  • The pod_name is a string of the form [environment]-[pod-template-hash]-[pod-id], for example staging-2313430526-9jpdo.

In order to provide a single continuous and accurate line chart, the metric query should:

  • Return the average across multiple pods, if there are more than one
  • Summarize across multiple deployments to the environment, as the pod-template-hash changes each deploy.

Now that we have our metric data for a given environment, we can display it on the respective Environments detail page.

Designs

environments__monitoring

Clicking the name of the environment would take you back to the current environment table. Example: https://gitlab.com/gitlab-com/environments/environments/12441

To get back to the monitoring page from an environment build/commit table, we need to add the same icon we are adding to the environments list:

Screen_Shot_2017-01-23_at_10.28.50_AM

The placement should be the same on both tables, next to the external url button.

Empty States

If not configured (Prometheus Integration is not active)

environments__monitoring--get-started

Get started with performance monitoring

Stay updated about the performance and health of your environment by configuring Prometheus to easily monitor your deployments. Visit our documentation to [learn more about performance monitoring]. link to documention

Configure Prometheus to get started

If configured but no data yet

environments__monitoring--loading-data

Attempting to load performance data

We are working on creating your graphs using the data from the Prometheus server. More information is available in our documentation.

[View documentation] button to documentation

Error 1

environments__monitoring--error1

Unable to connect to Prometheus server

An error has occurred in contacting the Prometheus server. Please ensure connectivity is available from the GitLab server to the configured Prometheus server.

[View documentation] button to documentation

Error 2

environments__monitoring--error2

We could not find performance data for this Environment

We are having a hard time retrieving performance data for this environment from the Prometheus server. We attempted to retrieve container_cpu_usage_seconds_total and container_memory_usage_bytes. An environment label is required on each metric to identify the Environment. More information is available in our documentation.

[View documentation] button to documentation

Links / references

Empty states svgs: graphics-svg.zip