Find a file
Yorick Peterse 141e946c3d Storing of application metrics in InfluxDB
This adds the ability to write application metrics (e.g. SQL timings) to
InfluxDB. These metrics can in turn be visualized using Grafana, or
really anything else that can read from InfluxDB. These metrics can be
used to track application performance over time, between different Ruby
versions, different GitLab versions, etc.

== Transaction Metrics

Currently the following is tracked on a per transaction basis (a
transaction is a Rails request or a single Sidekiq job):

* Timings per query along with the raw (obfuscated) SQL and information
  about what file the query originated from.
* Timings per view along with the path of the view and information about
  what file triggered the rendering process.
* The duration of a request itself along with the controller/worker
  class and method name.
* The duration of any instrumented method calls (more below).

== Sampled Metrics

Certain metrics can't be directly associated with a transaction. For
example, a process' total memory usage is unrelated to any running
transactions. While a transaction can result in the memory usage going
up there's no accurate way to determine what transaction is to blame,
this becomes especially problematic in multi-threaded environments.

To solve this problem there's a separate thread that takes samples at a
fixed interval. This thread (using the class Gitlab::Metrics::Sampler)
currently tracks the following:

* The process' total memory usage.
* The number of file descriptors opened by the process.
* The amount of Ruby objects (using ObjectSpace.count_objects).
* GC statistics such as timings, heap slots, etc.

The default/current interval is 15 seconds, any smaller interval might
put too much pressure on InfluxDB (especially when running dozens of
processes).

== Method Instrumentation

While currently not yet used methods can be instrumented to track how
long they take to run. Unlike the likes of New Relic this doesn't
require modifying the source code (e.g. including modules), it all
happens from the outside. For example, to track `User.by_login` we'd add
the following code somewhere in an initializer:

    Gitlab::Metrics::Instrumentation.
      instrument_method(User, :by_login)

to instead instrument an instance method:

    Gitlab::Metrics::Instrumentation.
      instrument_instance_method(User, :save)

Instrumentation for either all public model methods or a few crucial
ones will be added in the near future, I simply haven't gotten to doing
so just yet.

== Configuration

By default metrics are disabled. This means users don't have to bother
setting anything up if they don't want to. Metrics can be enabled by
editing one's gitlab.yml configuration file (see
config/gitlab.yml.example for example settings).

== Writing Data To InfluxDB

Because InfluxDB is still a fairly young product I expect the worse.
Data loss, unexpected reboots, the database not responding, you name it.
Because of this data is _not_ written to InfluxDB directly, instead it's
queued and processed by Sidekiq. This ensures that users won't notice
anything when InfluxDB is giving trouble.

The metrics worker can be started in a standalone manner as following:

    bundle exec sidekiq -q metrics

The corresponding class is called MetricsWorker.
2015-12-17 17:25:48 +01:00
app Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
bin Add 'resume' capability to parallel-rsync-repos 2015-12-08 15:08:22 +01:00
builds Add missing builds/ folder to fix backup tests 2015-09-15 22:19:31 +02:00
config Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
db Fix ci_projects migration by using the value only from latest row [ci skip] 2015-12-17 11:09:59 +01:00
doc Use gitlab-workhorse 0.5.1 2015-12-17 11:55:13 +01:00
docker Fix typo 2015-09-30 19:54:56 +02:00
features Upgrade Poltergeist to 1.8.1. #4131 2015-12-17 01:01:08 -05:00
lib Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
log init commit 2011-10-09 00:36:38 +03:00
public Fix: Images cannot show when projects' path was changed 2015-10-14 18:50:35 +03:00
scripts Test using a 1.9.8 phantomjs version built with fpm 2015-11-29 13:44:19 +02:00
shared Make sure everyone has shared/lfs-objects 2015-12-09 16:19:59 +01:00
spec Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
tmp Remove tmp/.gitkeep 2015-10-04 13:49:48 +00:00
vendor/assets Vendor clipboard.js 2015-10-23 15:29:09 +02:00
.flayignore Add flay: tool to find duplicate code 2015-11-11 16:29:00 +01:00
.foreman complete hooks for post receive 2012-01-08 13:20:20 +02:00
.gitattributes Use gitattribute merge=union to reduce CHANGELOG merge conflicts. 2015-02-12 20:50:09 +01:00
.gitignore Add support for git lfs. 2015-11-16 12:39:13 +01:00
.gitlab-ci.yml Revert "Merge branch 'remove-redcloth' into 'master' " 2015-12-11 16:16:07 +01:00
.hound.yml Make houndci prefer single quotes. 2014-07-16 09:38:42 +03:00
.pkgr.yml Use new way of defining services on packager.io 2015-01-18 17:55:48 +00:00
.rspec Make Fuubar the default rspec formatter 2015-06-26 01:01:13 -04:00
.rubocop.yml Disabled Rails/Date cop 2015-12-15 00:54:26 -02:00
.ruby-version Update .ruby-version to 2.1.7 2015-12-03 23:14:19 +01:00
.simplecov organize simplecov 2013-01-07 22:23:13 +02:00
.teatro.yml teatro setup 2014-06-17 11:21:49 +03:00
CHANGELOG Api support for requesting starred projects for user 2015-12-16 21:46:00 +01:00
config.ru Disable Unicorn::WorkerKiller in non-production environments 2015-05-27 22:57:49 -04:00
CONTRIBUTING.md Fix links [ci skip] 2015-12-15 00:44:02 +02:00
doc_styleguide.md Use single spaces 2015-11-04 17:07:21 +00:00
docker-compose.yml Update docker guide and add docker-compose.yml 2015-09-30 14:24:39 +02:00
Gemfile Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
Gemfile.lock Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
GITLAB_SHELL_VERSION Bump gitlab-shell to 2.6.8 2015-11-25 13:08:47 +01:00
GITLAB_WORKHORSE_VERSION Use gitlab-workhorse 0.5.1 2015-12-17 11:55:13 +01:00
LICENSE LICENSE year update 2015-03-30 11:03:42 +03:00
MAINTENANCE.md Add note about semantic versioning not being absolute. 2015-01-10 21:48:35 -08:00
PROCESS.md update guides for feature proposals on the issue tracker 2015-12-14 13:06:16 +01:00
Procfile Storing of application metrics in InfluxDB 2015-12-17 17:25:48 +01:00
Rakefile init commit 2011-10-09 00:36:38 +03:00
README.md Bump Redis requirement to 2.8 for Sidekiq 4 requirements 2015-12-12 07:51:50 -08:00
VERSION Bump VERSION 2015-11-17 11:59:22 -05:00

GitLab

build status Build Status Code Climate Coverage Status

Canonical source

The source of GitLab Community Edition is hosted on GitLab.com and there are mirrors to make contributing as easy as possible.

Open source software to collaborate on code

To see how GitLab looks please see the features page on our website.

  • Manage Git repositories with fine grained access controls that keep your code secure
  • Perform code reviews and enhance collaboration with merge requests
  • Each project can also have an issue tracker and a wiki
  • Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
  • Completely free and open source (MIT Expat license)
  • Powered by Ruby on Rails

Editions

There are two editions of GitLab:

  • GitLab Community Edition (CE) is available freely under the MIT Expat license.
  • GitLab Enterprise Edition (EE) includes extra features that are more useful for organizations with more than 100 users. To use EE and get official support please become a subscriber.

Website

On about.gitlab.com you can find more information about:

Requirements

Please see the requirements documentation for system requirements and more information about the supported operating systems.

Installation

The recommended way to install GitLab is with the Omnibus packages on our package server. Compared to an installation from source, this is faster and less error prone. Just select your operating system, download the respective package (Debian or RPM) and install it using the system's package manager.

There are various other options to install GitLab, please refer to the installation page on the GitLab website for more information.

You can access a new installation with the login root and password 5iveL!fe, after login you are required to set a unique password.

Install a development environment

To work on GitLab itself, we recommend setting up your development environment with the GitLab Development Kit. If you do not use the GitLab Development Kit you need to install and setup all the dependencies yourself, this is a lot of work and error prone. One small thing you also have to do when installing it yourself is to copy the example development unicorn configuration file:

cp config/unicorn.rb.example.development config/unicorn.rb

Instructions on how to start GitLab and how to run the tests can be found in the development section of the GitLab Development Kit.

Software stack

GitLab is a Ruby on Rails application that runs on the following software:

  • Ubuntu/Debian/CentOS/RHEL
  • Ruby (MRI) 2.1
  • Git 1.7.10+
  • Redis 2.8+
  • MySQL or PostgreSQL

For more information please see the architecture documentation.

Third-party applications

There are a lot of third-party applications integrating with GitLab. These include GUI Git clients, mobile applications and API wrappers for various languages.

GitLab release cycle

For more information about the release process see the release documentation.

Upgrading

For upgrading information please see our update page.

Documentation

All documentation can be found on doc.gitlab.com/ce/.

Getting help

Please see Getting help for GitLab on our website for the many options to get help.

Is it any good?

Yes

Is it awesome?

Thanks for asking this question Joshua. These people seem to like it.