gitlab-org--gitlab-foss/doc/monitoring/performance/grafana_configuration.md
2016-06-23 11:37:02 +02:00

38 KiB

Grafana Configuration

Grafana is a tool that allows you to visualize time series metrics through graphs and dashboards. It supports several backend data stores, including InfluxDB. GitLab writes performance data to InfluxDB and Grafana will allow you to query InfluxDB to display useful graphs.

For the easiest installation and configuration, install Grafana on the same server as InfluxDB. For larger installations, you may want to split out these services.

Installation

Grafana supplies package repositories (Yum/Apt) for easy installation. See Grafana installation documentation for detailed steps.

Note

: Before starting Grafana for the first time, set the admin user and password in /etc/grafana/grafana.ini. Otherwise, the default password will be admin.

Configuration

Login as the admin user. Expand the menu by clicking the Grafana logo in the top left corner. Choose 'Data Sources' from the menu. Then, click 'Add new' in the top bar.

Grafana empty data source page

Fill in the configuration details for the InfluxDB data source. Save and Test Connection to ensure the configuration is correct.

  • Name: InfluxDB
  • Default: Checked
  • Type: InfluxDB 0.9.x (Even if you're using InfluxDB 0.10.x)
  • Url: https://localhost:8086 (Or the remote URL if you've installed InfluxDB on a separate server)
  • Access: proxy
  • Database: gitlab
  • User: admin (Or the username configured when setting up InfluxDB)
  • Password: The password configured when you set up InfluxDB

Grafana data source configurations

Apply retention policies and create continuous queries

If you intend to import the GitLab provided Grafana dashboards, you will need to copy and run a set of queries against InfluxDB to create the needed data sets.

On the InfluxDB server, run the following command, substituting your InfluxDB user and password:

influxdb --username admin -password super_secret

This will drop you in to an InfluxDB interactive session. Copy the entire contents below and paste it in to the interactive session:

CREATE RETENTION POLICY default ON gitlab DURATION 1h REPLICATION 1 DEFAULT
CREATE RETENTION POLICY downsampled ON gitlab DURATION 7d REPLICATION 1
CREATE CONTINUOUS QUERY grape_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.grape_git_timings_per_action FROM "default".rails_method_calls WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY grape_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.grape_markdown_render_timings_overall FROM "default".rails_transactions WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.grape_markdown_render_timings_per_action FROM "default".rails_transactions WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY grape_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.grape_markdown_timings_overall FROM "default".rails_method_calls WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND method =~ /^Banzai/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.grape_method_call_timings_per_action_and_method FROM "default".rails_method_calls WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), method, action END
CREATE CONTINUOUS QUERY grape_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.grape_method_call_timings_per_method FROM "default".rails_method_calls WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), method END
CREATE CONTINUOUS QUERY grape_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.grape_transaction_counts_overall FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.grape_transaction_counts_per_action FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY grape_transaction_new_redis_connection_counts_overall ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.grape_transaction_new_redis_connection_counts_overall FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_transaction_new_redis_connection_counts_per_action ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.grape_transaction_new_redis_connection_counts_per_action FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY grape_transaction_sql_counts_overall ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.grape_transaction_sql_counts_overall FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_transaction_sql_counts_per_action ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.grape_transaction_sql_counts_per_action FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY grape_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(rails_queue_duration) AS rails_queue_duration_mean, percentile(rails_queue_duration, 95) AS rails_queue_duration_95th, percentile(rails_queue_duration, 99) AS rails_queue_duration_99th INTO downsampled.grape_transaction_timings_overall FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY grape_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(rails_queue_duration) AS rails_queue_duration_mean, percentile(rails_queue_duration, 95) AS rails_queue_duration_95th, percentile(rails_queue_duration, 99) AS rails_queue_duration_99th INTO downsampled.grape_transaction_timings_per_action FROM "default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_file_descriptor_counts ON gitlab BEGIN SELECT sum(value) AS count INTO downsampled.rails_file_descriptor_counts FROM "default".rails_file_descriptors GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_gc_counts ON gitlab BEGIN SELECT sum(count) AS total, sum(minor_gc_count) AS minor, sum(major_gc_count) AS major INTO downsampled.rails_gc_counts FROM "default".rails_gc_statistics GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_gc_timings ON gitlab BEGIN SELECT mean(total_time) AS duration_mean, percentile(total_time, 95) AS duration_95th, percentile(total_time, 99) AS duration_99th INTO downsampled.rails_gc_timings FROM "default".rails_gc_statistics GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.rails_git_timings_per_action FROM "default".rails_method_calls WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.rails_markdown_render_timings_overall FROM "default".rails_transactions WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.rails_markdown_render_timings_per_action FROM "default".rails_transactions WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.rails_markdown_timings_overall FROM "default".rails_method_calls WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND method =~ /^Banzai/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_memory_usage_overall ON gitlab BEGIN SELECT mean(value) AS memory_mean, percentile(value, 95) AS memory_95th, percentile(value, 99) AS memory_99th INTO downsampled.rails_memory_usage_overall FROM "default".rails_memory_usage GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.rails_method_call_timings_per_action_and_method FROM "default".rails_method_calls WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), method, action END
CREATE CONTINUOUS QUERY rails_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.rails_method_call_timings_per_method FROM "default".rails_method_calls WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), method END
CREATE CONTINUOUS QUERY rails_object_counts_overall ON gitlab BEGIN SELECT sum(count) AS count INTO downsampled.rails_object_counts_overall FROM "default".rails_object_counts GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_object_counts_per_type ON gitlab BEGIN SELECT sum(count) AS count INTO downsampled.rails_object_counts_per_type FROM "default".rails_object_counts GROUP BY time(1m), type END
CREATE CONTINUOUS QUERY rails_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.rails_transaction_counts_overall FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.rails_transaction_counts_per_action FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_transaction_new_redis_connection_counts_overall ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.rails_transaction_new_redis_connection_counts_overall FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_transaction_new_redis_connection_counts_per_action ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.rails_transaction_new_redis_connection_counts_per_action FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_transaction_sql_counts_overall ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.rails_transaction_sql_counts_overall FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_transaction_sql_counts_per_action ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.rails_transaction_sql_counts_per_action FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(rails_queue_duration) AS rails_queue_duration_mean, percentile(rails_queue_duration, 95) AS rails_queue_duration_95th, percentile(rails_queue_duration, 99) AS rails_queue_duration_99th INTO downsampled.rails_transaction_timings_overall FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY rails_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(rails_queue_duration) AS rails_queue_duration_mean, percentile(rails_queue_duration, 95) AS rails_queue_duration_95th, percentile(rails_queue_duration, 99) AS rails_queue_duration_99th INTO downsampled.rails_transaction_timings_per_action FROM "default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY rails_view_timings_per_action_and_view ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.rails_view_timings_per_action_and_view FROM "default".rails_views WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action, view END
CREATE CONTINUOUS QUERY sidekiq_file_descriptor_counts ON gitlab BEGIN SELECT sum(value) AS count INTO downsampled.sidekiq_file_descriptor_counts FROM "default".sidekiq_file_descriptors GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_gc_counts ON gitlab BEGIN SELECT sum(count) AS total, sum(minor_gc_count) AS minor, sum(major_gc_count) AS major INTO downsampled.sidekiq_gc_counts FROM "default".sidekiq_gc_statistics GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_gc_timings ON gitlab BEGIN SELECT mean(total_time) AS duration_mean, percentile(total_time, 95) AS duration_95th, percentile(total_time, 99) AS duration_99th INTO downsampled.sidekiq_gc_timings FROM "default".sidekiq_gc_statistics GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.sidekiq_git_timings_per_action FROM "default".sidekiq_method_calls WHERE method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.sidekiq_markdown_render_timings_overall FROM "default".sidekiq_transactions WHERE (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO downsampled.sidekiq_markdown_render_timings_per_action FROM "default".sidekiq_transactions WHERE (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.sidekiq_markdown_timings_overall FROM "default".sidekiq_method_calls WHERE method =~ /^Banzai/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_memory_usage_overall ON gitlab BEGIN SELECT mean(value) AS memory_mean, percentile(value, 95) AS memory_95th, percentile(value, 99) AS memory_99th INTO downsampled.sidekiq_memory_usage_overall FROM "default".sidekiq_memory_usage GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.sidekiq_method_call_timings_per_action_and_method FROM "default".sidekiq_method_calls GROUP BY time(1m), method, action END
CREATE CONTINUOUS QUERY sidekiq_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(cpu_duration) AS cpu_duration_mean, percentile(cpu_duration, 95) AS cpu_duration_95th, percentile(cpu_duration, 99) AS cpu_duration_99th, mean(call_count) AS call_count_mean, percentile(call_count, 95) AS call_count_95th, percentile(call_count, 99) AS call_count_99th INTO downsampled.sidekiq_method_call_timings_per_method FROM "default".sidekiq_method_calls GROUP BY time(1m), method END
CREATE CONTINUOUS QUERY sidekiq_object_counts_overall ON gitlab BEGIN SELECT sum(count) AS count INTO downsampled.sidekiq_object_counts_overall FROM "default".sidekiq_object_counts GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_object_counts_per_type ON gitlab BEGIN SELECT sum(count) AS count INTO downsampled.sidekiq_object_counts_per_type FROM "default".sidekiq_object_counts GROUP BY time(1m), type END
CREATE CONTINUOUS QUERY sidekiq_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.sidekiq_transaction_counts_overall FROM "default".sidekiq_transactions GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.sidekiq_transaction_counts_per_action FROM "default".sidekiq_transactions GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_transaction_new_redis_connection_counts_overall ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.sidekiq_transaction_new_redis_connection_counts_overall FROM "default".sidekiq_transactions GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_transaction_new_redis_connection_counts_per_action ON gitlab BEGIN SELECT max(new_redis_connections) AS new_redis_connections_max, mean(new_redis_connections) AS new_redis_connections_mean, percentile(new_redis_connections, 95) AS new_redis_connections_95th, percentile(new_redis_connections, 99) AS new_redis_connections_99th INTO downsampled.sidekiq_transaction_new_redis_connection_counts_per_action FROM "default".sidekiq_transactions GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_transaction_sql_counts_overall ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.sidekiq_transaction_sql_counts_overall FROM "default".sidekiq_transactions GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_transaction_sql_counts_per_action ON gitlab BEGIN SELECT max(sql_count) AS sql_count_max, mean(sql_count) AS sql_count_mean, percentile(sql_count, 95) AS sql_count_95th, percentile(sql_count, 99) AS sql_count_99th INTO downsampled.sidekiq_transaction_sql_counts_per_action FROM "default".sidekiq_transactions GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th INTO downsampled.sidekiq_transaction_timings_overall FROM "default".sidekiq_transactions GROUP BY time(1m) END
CREATE CONTINUOUS QUERY sidekiq_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, max(sql_duration) AS sql_duration_max, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th INTO downsampled.sidekiq_transaction_timings_per_action FROM "default".sidekiq_transactions GROUP BY time(1m), action END
CREATE CONTINUOUS QUERY sidekiq_view_timings_per_action_and_view ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO downsampled.sidekiq_view_timings_per_action_and_view FROM "default".sidekiq_views GROUP BY time(1m), action, view END
CREATE CONTINUOUS QUERY web_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO downsampled.web_transaction_counts_overall FROM "default".rails_transactions GROUP BY time(1m) END

Import Dashboards

You can now import a set of default dashboards that will give you a good start on displaying useful information. GitLab has published a set of default Grafana dashboards to get you started. Clone the repository or download a zip/tarball, then follow these steps to import each JSON file.

Open the dashboard dropdown menu and click 'Import'

Grafana dashboard dropdown

Click 'Choose file' and browse to the location where you downloaded or cloned the dashboard repository. Pick one of the JSON files to import.

Grafana dashboard import

Once the dashboard is imported, be sure to click save icon in the top bar. If you do not save the dashboard after importing it will be removed when you navigate away.

Grafana save icon

Repeat this process for each dashboard you wish to import.

Alternatively you can automatically import all the dashboards into your Grafana instance. See the README of the Grafana dashboards repository for more information on this process.


Read more on: