Commit Graph

1340 Commits

Author SHA1 Message Date
Douglas Barbosa Alexandre 837a9065f0 Ensure that we're only importing local pull requests 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre 98909dd12c Generate separate comments when importing GitHub Issues into GitLab 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre dc72a8b305 Refactoring GithubImport::Importer 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre 6c846ef83d Extract methods to import comments on a GitHub Pull Request 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre d72b25811e Doesn't import GitHub PR where branches were no longer available 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre f19bf0eaa7 Import comments on the diff of a GitHub Pull Request into GitLab 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre 223f7f5345 Import comments on GitHub Pull Request into GitLab 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre 95f1fe724a Import GitHub Pull Requests into GitLab 2016-01-05 15:24:55 -02:00
Dmitriy Zaporozhets 9914893954 Merge branch 'metrics-tuning' into 'master'
Tuning of metrics data to store

This removes data we don't really need, as well as making sure we don't overload any cache stores or databases.

See merge request !2265
2016-01-05 09:32:19 +00:00
Yorick Peterse 2ee8f55599 Automatically prefix transaction series names
This ensures Rails and Sidekiq transactions are split into the series
"rails_transactions" and "sidekiq_transactions" respectively.
2016-01-04 13:17:02 +01:00
Yorick Peterse 2ea464bb27 Use separate series for Rails/Sidekiq sample stats
This removes the need for any tags to differentiate between Sidekiq and
Rails statistics while still being able to separate the two.
2016-01-04 12:45:31 +01:00
Yorick Peterse 825b46f8a3 Track total method call times per transaction
This makes it easier to see where time is spent without having to
aggregate all the individual points in the method_calls series.
2016-01-04 12:19:45 +01:00
Yorick Peterse 66a997a914 Track total query/view timings in transactions 2016-01-04 12:14:36 +01:00
Yorick Peterse 96075be6f4 Ability to increment custom transaction values
This will be used to store/increment the total query/view rendering
timings on a per transaction basis. This in turn can greatly reduce the
amount of metrics stored.
2016-01-04 11:37:46 +01:00
Robert Speicher 1a1113f7c4 Simplify `ContributionsCalendar#starting_year` and `#starting_month` 2016-01-01 22:11:34 -05:00
Yorick Peterse cafc784ee1 Removed tracking of hostnames for metrics
This isn't hugely useful and mostly wastes InfluxDB space. We can re-add
this whenever needed (but only once we really need it).
2015-12-31 17:55:10 +01:00
Yorick Peterse bd9f86bb8a Use separate series for Rails/Sidekiq transactions
This removes the need for tagging all metrics with a "process_type" tag.
2015-12-31 17:52:51 +01:00
Yorick Peterse 55ed6e1c96 Cache InfluxDB settings after the first use
This ensures we don't need to load anything from either PostgreSQL or
the Rails cache whenever creating new InfluxDB connections.
2015-12-31 17:47:07 +01:00
Yorick Peterse a6c60127e3 Removed tracking of raw SQL queries
This particular setup had 3 problems:

1. Storing SQL queries as tags is very inefficient as InfluxDB ends up
   indexing every query (and they can get pretty large). Storing these
   as values instead means we can't always display the SQL as easily.
2. We already instrument ActiveRecord query methods, thus we already
   have timing information about database queries.
3. SQL obfuscation is difficult to get right and I'd rather not expose
   sensitive data by accident.
2015-12-31 17:14:02 +01:00
Yorick Peterse c936e4e3c8 Removed various default metrics tags
While it's useful to keep track of the different versions (Ruby, GitLab,
etc) doing so for every point wastes disk space and possibly also RAM
(which InfluxDB is all to eager to gobble up). If we want to see the
performance differences between different GitLab versions simply looking
at the performance since the last release date should suffice.
2015-12-31 11:26:04 +01:00
Douglas Barbosa Alexandre ff98c631c1 Make sure that is no pending migrations in Gitlab::CurrentSettings 2015-12-30 14:26:54 -02:00
Yorick Peterse 701e5de910 Use Gitlab::CurrentSettings for InfluxDB
This ensures we can still start up even when not connecting to a
database.
2015-12-29 15:49:12 +01:00
Yorick Peterse 620e7bb3d6 Write to InfluxDB directly via UDP
This removes the need for Sidekiq and any overhead/problems introduced
by TCP. There are a few things to take into account:

1. When writing data to InfluxDB you may still get an error if the
   server becomes unavailable during the write. Because of this we're
   catching all exceptions and just ignore them (for now).
2. Writing via UDP apparently requires the timestamp to be in
   nanoseconds. Without this data either isn't written properly.
3. Due to the restrictions on UDP buffer sizes we're writing metrics one
   by one, instead of writing all of them at once.
2015-12-29 14:53:45 +01:00
Yorick Peterse 03478e6d5b Strip newlines from obfuscated SQL
Newlines aren't really needed and they may mess with InfluxDB's line
protocol.
2015-12-29 13:40:08 +01:00
Dmitriy Zaporozhets 58bc4b72d5 Merge branch 'feature/recaptcha_settings' into 'master'
Makes reCAPTCHA configurable through Application Settings screen

Following the work made by @stanhu here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2216, made it configurable without needing to restart Gitlab

See merge request !2231
2015-12-29 09:39:54 +00:00
Yorick Peterse ed214a11ca Handle missing settings table for metrics
This ensures we can still boot, even when the "application_settings"
table doesn't exist.
2015-12-28 22:38:34 +01:00
Gabriel Mazetto a3469d914a reCAPTCHA is configurable through Admin Settings, no reload needed. 2015-12-28 18:50:29 -02:00
Yorick Peterse 4d925f2147 Move InfluxDB settings to ApplicationSetting 2015-12-28 18:00:32 +01:00
Dmitriy Zaporozhets 540eb0a9af Merge branch 'influxdb' into 'master'
Storing of application metrics in InfluxDB

This adds support for tracking metrics in InfluxDB, which in turn can be visualized using Grafana. For more information see #2936.

See merge request !2042
2015-12-28 13:42:15 +00:00
Yorick Peterse 1be5668ae0 Added host option for InfluxDB 2015-12-28 13:14:48 +01:00
Yorick Peterse ddca57d3f2 Use String#delete for removing double quotes 2015-12-28 11:33:40 +01:00
Douwe Maan 43a3a401bd Merge branch 'master' into mention-all 2015-12-24 20:34:19 +01:00
Douwe Maan 835333c426 Merge branch 'ldap-special-chars-fix' into 'master'
Fix identity and user retrieval when special characters are used

Fixes #4023

I also added tests to make sure the user with special characters in his name is returned correctly.

@rspeicher this probably should be added to 8.3 as a patch.

See merge request !2176
2015-12-24 16:35:00 +00:00
Douwe Maan 672cbbff95 Only allow group/project members to mention `@all` 2015-12-24 15:33:51 +01:00
Douwe Maan 84e75ebd4c Merge branch 'fix/visibility-level-setting-in-forked-projects' into 'master'
Fix/visibility level setting in forked projects

Fixes #3136

/cc @DouweM 

See merge request !1744
2015-12-24 12:09:38 +00:00
Douwe Maan 662aa8ec35 No mb_chars needed anymore 2015-12-24 12:37:46 +01:00
Patricio Cano 1d3889eb46 Fix identity and user retrieval when special characters are used 2015-12-22 13:23:35 -05:00
Douwe Maan 9832e60ffb Merge branch 'tduehr/gitlab-ce-cas-support' 2015-12-21 17:38:37 +01:00
Douwe Maan e209ba7002 Merge branch 'git-version' into 'master'
Show git version on admin page

Before
![git-version-beore](/uploads/57444ad42220c9dfe8f187b8e399227f/git-version-beore.png)

After
![git-version-after](/uploads/cc1b52ae1a251c2c46d9626c040726ab/git-version-after.png)

gitlab-org/gitlab-ce#4077




See merge request !2101
2015-12-21 16:33:18 +00:00
Tomasz Maczukin 3cfd892f38 Merge branch 'master' into fix/visibility-level-setting-in-forked-projects
* master: (723 commits)
  Bump Rack Attack to v4.3.1 for security fix
  Remove duplicate entry in the changelog
  Remove extra spaces after branchname
  Fix merge-request-reopen button title
  Add branch and tag operation to tree dropdown
  Use gitlab-shell 2.6.9
  Clarify Windows shell executor artifact upload support
  Fix feature specs: we always show the build status if ci_commit is present
  Do not display project group/name when issue and MR are in same project
  Don't create CI status for refs that doesn't have .gitlab-ci.yml, even if the builds are enabled
  Use gitlab-workhorse 0.5.1
  Fix ci_projects migration by using the value only from latest row [ci skip]
  Revert sidebar position for issue and merge request
  Add info on using private Docker registries in CI [ci skip]
  Upgrade Poltergeist to 1.8.1. #4131
  Fix ux issue with "This issue will be closed automatically" message
  Move MR Builds tab next to Commits
  Api support for requesting starred projects for user
  Fix Rubocop complain.
  Fix merge widget JS for buttons
  ...

Conflicts:
	app/models/project.rb
2015-12-21 13:27:34 +01:00
Drew Blessing f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06:00
Yorick Peterse f181f05e8a Track object counts using the "allocations" Gem
This allows us to track the counts of actual classes instead of "T_XXX"
nodes. This is only enabled on CRuby as it uses CRuby specific APIs.
2015-12-17 17:25:48 +01:00
Yorick Peterse a93a32a290 Support for instrumenting class hierarchies
This will be used to (for example) instrument all ActiveRecord models.
2015-12-17 17:25:48 +01:00
Yorick Peterse a41287d898 Only track method calls above a certain threshold
This ensures we don't end up wasting resources by tracking method calls
that only take a few microseconds. By default the threshold is 10
milliseconds but this can be changed using the gitlab.yml configuration
file.
2015-12-17 17:25:48 +01:00
Yorick Peterse 13dbd663ac Allow filtering of what methods to instrument
This makes it possible to determine if a method should be instrumented
or not using a block.
2015-12-17 17:25:48 +01:00
Yorick Peterse 9f95ff0d90 Track location information as tags
This allows the information to be displayed when using certain functions
(e.g. top()) as well as making it easier to aggregate on a per file
basis.
2015-12-17 17:25:48 +01:00
Yorick Peterse f932b781a7 Replace double quotes when obfuscating SQL
InfluxDB escapes double quotes upon output which makes it a pain to deal
with. This ensures that if we're using PostgreSQL we don't store any
queries containing double quotes in InfluxDB, solving the escaping
problem.
2015-12-17 17:25:48 +01:00
Yorick Peterse 09a311568a Track object count types as tags 2015-12-17 17:25:48 +01:00
Yorick Peterse 641761f1d6 Only instrument methods defined directly
When using instrument_methods/instrument_instance_methods we only want
to instrument methods defined directly in a class, not those included
via mixins (e.g. whatever RSpec throws in during development).

In case an externally included method _has_ to be instrumented we can
still use the regular instrument_method/instrument_instance_method
methods.
2015-12-17 17:25:48 +01:00
Yorick Peterse f43f3b89a6 Added Instrumentation.configure
This makes it easier to instrument multiple modules without having to
type the full namespace over and over again.
2015-12-17 17:25:48 +01:00