Skip to content
Snippets Groups Projects

Added Prometheus Service and Prometheus graphs

Merged Kamil Trzciński requested to merge prometheus-monitoring into master
All threads resolved!

What does this MR do?

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/26910

This MR adds a Prometheus Service, with support for fetching metrics for an environment and displaying that on environments page.

We miss actual data fetching, but this is a placeholder that can be used to be worked on.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

prom-ux.mov

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Functionality Notes

Kamil: Please, edit queries and @jivanvl can add graphs to metrics action of environments_controller, as part of my MR: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8935

Kamil: For development make sure to have sidekiq running as the data is fetched in the background, API can return the http status code 204 it means that the data is not yet ready, retry with some delay if that happens. In normal circumstances you will receive a 200 http status code with the JSON status: true

Josh: I spun up a prometheus server outside of the omnibus package, here: https://kubeprom.35.185.3.210.nip.io/graph. This one has the k8s metrics we want to use for this.

\cc @joshlambert @ayufan

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Joshua Lambert added 1 commit

    added 1 commit

    • fb2447cb - Change query to be a simple scalar to reduce load and any chance for failure.

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    • a9b4bcf8 - Update Prometheus queries for CPU and Memory.

    Compare with previous version

  • Joshua Lambert resolved all discussions

    resolved all discussions

  • Joshua Lambert added 1 commit

    added 1 commit

    • f8fc6a23 - Adjust CPU metrics for 2min rate.

    Compare with previous version

  • What issue does this relate to?

  • Joshua Lambert added 1 commit

    added 1 commit

    • a947eebc - Fix wording of API URL default text

    Compare with previous version

  • Jose Ivan Vargas added 660 commits

    added 660 commits

    • a947eebc...4aa66428 - 650 commits from branch master
    • 1703e926 - Add PrometheusService with API URL
    • f6846dbc - Added metrics endpoint to EnvironmentsController
    • 46b59386 - Added metrics views
    • 5ef7bdc6 - Fetch monitoring data from Prometheus
    • 96b5a9bb - Include last_update in response
    • 5e1989b2 - Change Prometheus test ping to a functional query so it returns success.
    • 8f6d8b74 - Change query to be a simple scalar to reduce load and any chance for failure.
    • b412efe6 - Update Prometheus queries for CPU and Memory.
    • f4d7fa16 - Adjust CPU metrics for 2min rate.
    • 8cac0bb3 - Fix wording of API URL default text

    Compare with previous version

  • Rémy Coutable added 1 commit

    added 1 commit

    • ff918058 - Add a controller test and tweak the view a bit

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    • 5739c269 - Add Prometheus to import/export model list.

    Compare with previous version

  • Jose Ivan Vargas added 7 commits

    added 7 commits

    • 50ba999f - Created initial version of the graph
    • 804e527a - Improvements to the design and code cleanup
    • dc800eed - Code cleanup
    • 4983a21c - Changed the getData method a $.ajax call
    • 2e8807e5 - Added initial version of specs
    • af17318b - Improved spec coverage on prometheus_graph.js
    • f9390414 - Merge branch 'prometheus-graphs' into prometheus-monitoring

    Compare with previous version

  • added 1 commit

    • 69866fc6 - Removed the median from the current graphs, also, fixed tests

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    • 9c893e54 - Update monitoring service comment text, and add Prometheus service help text.

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    • c95f1a15 - Update metrics button icon, clarify legend text and page title.

    Compare with previous version

  • @joshlambert you have conflicts and it is a WIP so I cannot merge. Remove the WIP and fix the conflicts and assign to me.

  • Joshua Lambert added 1 commit

    added 1 commit

    • 29e23595 - Fix trailing space on metrics.html.haml

    Compare with previous version

  • Rémy Coutable added 1 commit

    added 1 commit

    • 44325b48 - Add specs for Gitlab::Prometheus

    Compare with previous version

  • Joshua Lambert added 284 commits

    added 284 commits

    Compare with previous version

  • Joshua Lambert added 1 commit

    added 1 commit

    • fe9e5103 - Resolve javascript es6 extension issues, indenting.

    Compare with previous version

  • Joshua Lambert unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Rémy Coutable added 3 commits

    added 3 commits

    • fc97a025 - Don't pass time for query Prometheus queries
    • 0f24dd33 - Improve Gitlab::Prometheus specs
    • dc8c63ef - Add specs for PrometheusService

    Compare with previous version

  • @joshlambert LGTM. Would you like me to merge?

  • Rémy Coutable added 5 commits

    added 5 commits

    • 2ca8793e - Fix Rubocop offenses
    • 39eaf07d - Add specs for Environment
    • 2e9983d9 - Add a title to the metrics button
    • c5275f4e - Improve PrometheusHelpers and related specs
    • d9917e54 - Add feature spec for Environment metrics

    Compare with previous version

  • Kamil Trzciński
  • Kamil Trzciński
  • Rémy Coutable added 255 commits

    added 255 commits

    • d9917e54...56814482 - 253 commits from branch master
    • a2f7a719 - Remove metrics expectations from the environment feature spec
    • fda6a54a - Merge remote-tracking branch 'origin/master' into prometheus-monitoring

    Compare with previous version

  • assigned to @rymai

  • Rémy Coutable added 1 commit

    added 1 commit

    • 01a6c1b9 - Add PrometheusService and metrics page for environment

    Compare with previous version

  • Rémy Coutable changed milestone to %9.0

    changed milestone to %9.0

  • Rémy Coutable added 1 commit

    added 1 commit

    • c78e7fe3 - Add PrometheusService and metrics page for environment

    Compare with previous version

  • Rémy Coutable resolved all discussions

    resolved all discussions

  • Rémy Coutable added 1 commit

    added 1 commit

    • 9310bc99 - Add PrometheusService and metrics page for environment

    Compare with previous version

  • The last commit should fix the V3 API failure. I've also opened an EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1374

  • Rémy Coutable added 1 commit

    added 1 commit

    • 87d3cdcd - Add PrometheusService and metrics page for environment

    Compare with previous version

  • mentioned in issue #26944 (closed)

  • mentioned in issue #28717 (closed)

  • mentioned in issue #42251 (closed)

  • mentioned in merge request gitlab!84351 (merged)

  • Please register or sign in to reply
    Loading