Commit Graph

352 Commits

Author SHA1 Message Date
Ryan Cobb 04962880ad Fix process start time
Previously we were recording process start time as seconds from boot.
This makes it so we record as epoch time.
2019-07-04 10:24:19 +00:00
Aleksei Lipniagov 97f411b796 Use PROCESS_CPUTIME_ID for cpu time metrics
To measure ruby cpu time, we should use PROCESS_CPUTIME_ID instead of
THREAD_CPUTIME_ID in our environments.
2019-06-28 14:47:35 +03:00
Sarah Yasonik 9c50cf03f5 Add permission check to dashboards
Adds permission checks to the metrics_dashboard endpoint. Users
with role of Reporter or above should have access to view the
metrics for a given project.
2019-06-27 10:54:29 +00:00
Sarah Yasonik f49dd76a44 Add embedding flag and filter to CPU/Mem
This commits adds support for metrics dashboards
for embedding. If the flag 'embedded' is provided
to the environments/id/metrics_dashboard endpoint,
the response will be suitable for embedding in
issues or other content.

This is a precursor for support for embedding
metrics in GFM.
2019-06-20 14:06:18 +00:00
Sarah Yasonik 1b7464ed84 Specify a dropdown name for dashboards 2019-06-14 15:55:08 +00:00
Sarah Yasonik 15c8d29bd6 Refactor for cleaner caching in dashboards
Opts to cache a full list of cached dashboards
to better manage removing items from the cache.
This also allows dashboards to be stored in the
cache that don't necessarily correspond to a
single dashboard yml.
2019-06-13 16:45:36 +00:00
Sean McGivern 83d8af2435 Merge branch 'prom-api-1' into 'master'
Update server API to enable switch prometheus endpoint

See merge request gitlab-org/gitlab-ce!29186
2019-06-11 11:26:01 +00:00
syasonik ecdc50b198 Switch errors to inherit from a base class
Error classes associated with individual stages of
dashboard processing tend to have very long names.
As dashboard post-processing includes more steps,
we will likely need to handle more error cases.
Refactoring to have all errors inherit from a specific
base class will help accommodate this and keep the code
more readable.
2019-06-06 23:05:19 +01:00
Ryan Cobb 7131ad46c6 Adds sidekiq worker label for ruby metrics 2019-06-06 13:19:50 -06:00
syasonik cd94500a42 Address rubocop errors 2019-06-06 11:43:50 +01:00
syasonik 54dd44030b Expose prometheus endpoint per metric in dashboard
Adds a new stage to dashboard processesing step for the
EnvironmentsController::metrics_dashboard endpoint.

Allows the front end to avoid generating the endpoint
unitutive string mutations.
2019-06-06 11:43:50 +01:00
Bob Van Landuyt 327cae1da7 Merge branch '61964-unicorn-instrumentation' into 'master'
Adds ruby and unicorn instrumentation

Closes #61964

See merge request gitlab-org/gitlab-ce!28499
2019-06-04 17:59:04 +00:00
Ryan Cobb 4c6b1fc23c Add comment to clarify system proc stat field 2019-06-04 10:04:36 -06:00
Jan Provaznik d4a83ce5a3 Ignore Puma empty worker stats
In some cases (during worker start) it's possible that
Puma.stats returns an empty hash for worker's last status. In
that case we just skip sampling of the worker until these
stats are available.
2019-06-04 09:11:55 +00:00
Ryan Cobb e9ae881c9a Remove unnecessary super call in unicorn sampler 2019-06-03 11:18:54 -06:00
Ryan Cobb 0393c5059d Merge branch 'master' into 61964-unicorn-instrumentation 2019-05-29 10:56:38 -06:00
Jan Provaznik a5adc6a024 Add Puma sampler
This sampler gathers Puma-specific metrics which can be used by
Prometheus then.
2019-05-29 12:27:44 +00:00
Ryan Cobb 4fae62b9ef Fix typo in system.rb 2019-05-20 14:26:30 -06:00
Ryan Cobb 9eeedfccbc Adds ruby and unicorn instrumentation
This adds ruby and unicorn instrumentation. This was originally
intended in 11.11 but due to performance concerns it was reverted. This
new commit foregoes the sys-proctable gem was causing performance issues
previously.
2019-05-20 13:36:59 -06:00
Ryan Cobb 2334b07726 Revert "Merge branch '56850-add-new-unicorn-metrics' into 'master'"
This reverts merge request !27474
2019-05-20 14:34:00 +00:00
Ash McKenzie c5a9bc17a1 Merge branch '56850-add-new-unicorn-metrics' into 'master'
Resolve "Add new Unicorn metrics"

Closes #56850

See merge request gitlab-org/gitlab-ce!27474
2019-05-07 16:21:40 +00:00
Stan Hu f93b2e02a5 Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
Sarah Yasonik 552a3d2fd9 Update metrics dashboard API to load yml from repo
Updates the EnvironmentController#metrics_dashboard endpoint
to support a "dashboard" param, which can be used to specify
the filepath of a dashboard configuration from a project
repository. Dashboard configurations are expected to be
stored in .gitlab/dashboards/.

Updates dashboard post-processing steps to exclude custom
metrics, which should only display on the system dashboard.
2019-05-01 10:16:03 +00:00
Ryan Cobb 17986d91a5 Add back ruby_memory_bytes metric, limit duplication, clean up
This adds back ruby_memory_bytes for backwards compatibility, limits
code duplication, cleans up unused methods, and limits the unicorn
worker sampling scope.
2019-04-29 12:13:02 -06:00
Ryan Cobb 2f6a1e77bc Cleanup syntax in System max_open_file_descriptors 2019-04-26 10:16:53 -06:00
syasonik 0e093940e1 Move dashboard param to initialize method 2019-04-25 14:13:43 +08:00
syasonik 8926b37d5b Prefer safe_load and deep_symbolize_keys 2019-04-25 14:00:51 +08:00
syasonik 4a5c48c47c Move MetricsDashboard to Metrics::Dashboard 2019-04-25 13:35:05 +08:00
Ryan Cobb bb27bf4a1c Update docs and calculate process start time via proc table
This updates monitor docs to reflect the new ruby and unicorn metrics as
well as making it so we fetch process start time via the proc table
instead of via CLOCK_BOOTTIME
2019-04-24 17:05:09 -06:00
Ryan Cobb 174a03dfc2 Move process specific metrics to ruby sampler
These metrics are not unicorn specific and can be used across ruby
processes
2019-04-24 13:01:51 -06:00
Ryan Cobb 4c248c05cb Adds new metrics for unicorn monitoring
This adds new metrics for monitoring unicorn. These metrics include
process_cpu_seconds_total, process_start_time_seconds, process_max_fds,
and unicorn_workers.
2019-04-18 13:46:56 -06:00
Ryan Cobb 5543d897d0 Filters branch and path labels for metrics 2019-04-04 10:56:12 +00:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
Sarah Yasonik e6fcdd7aca Update Metrics references to Object path
On reload, references to Metrics within classes in the Gitlab::Metrics
module fail. Update all references to ::Gitlab::Metrics so that
constant lookup finds the right module in development. This fix should
not impact production.
2019-02-14 18:05:35 +00:00
Ben Kochie 54438ad04b
Clean up unicorn sampler metric labels
Change `type` and `address` labels to be less generic to avoid conflicts
with other systems.
2019-02-06 14:19:51 +01:00
Lin Jen-Shin 965f40d9ac Port this style change from EE 2019-01-30 01:16:43 +08:00
gfyoung 7ec8af5017 Enable even more frozen string for lib/gitlab
Enables frozen string for the following:

* lib/gitlab/hook_data/**/*.rb
* lib/gitlab/i18n/**/*.rb
* lib/gitlab/import/**/*.rb
* lib/gitlab/import_export/**/*.rb
* lib/gitlab/kubernetes/**/*.rb
* lib/gitlab/legacy_github_import/**/*.rb
* lib/gitlab/manifest_import/**/*.rb
* lib/gitlab/metrics/**/*.rb
* lib/gitlab/middleware/**/*.rb

Partially addresses gitlab-org/gitlab-ce#47424.
2018-11-16 17:41:14 -08:00
William George 1b153d497b Make getting a user by the username case insensitive 2018-10-18 09:06:44 +00:00
Mark Chao bec7f06097 Ignore irrelevant sql commands in metrics
Fix #51005
2018-09-05 09:10:19 +08:00
Yorick Peterse 81d8ddf8ca
Add a 10 ms bucket for SQL timings
This allows us to calculate quantiles of SQL timings more accurately,
instead of a lot of timings being assigned to the 50 ms bucket.
2018-07-10 15:59:30 +02:00
Lin Jen-Shin 9286f5b934 Use stable gitlab-styles and eliminate offenses 2018-07-09 21:13:08 +08:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Ben Kochie 78a9991543
Cleanup ruby sampler metrics
* Use a simple counter for sampler duration instead of a histogram.
* Use a counter to collect GC time.
* Remove unused objects metric.
* Cleanup metric names to match Prometheus conventions.
* Prefix generic GC stats with `gc_stat`.
* Include worker label on memory and file descriptor metrics.
2018-06-22 14:12:22 +02:00
Stan Hu 88ceef87e3 Merge branch 'limit-metrics-content-type' into 'master'
Limit the action suffixes in transaction metrics

See merge request gitlab-org/gitlab-ce!20032
2018-06-20 16:34:42 +00:00
Yorick Peterse d527b46802
Remove remaining traces of the Allocations Gem
In MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15834 we
removed use of the data produced by the Allocations Gem. However, we
never removed the code that just enables tracking of allocations. In
this commit we remove all remaining traces of this Gem.
2018-06-20 15:11:10 +02:00
Yorick Peterse d73e68deb5
Limit the action suffixes in transaction metrics
There seem to be a lot of cases where the suffix of an action (e.g.
".html") is set to bogus data, such as "*/*" or entire URLs. This can
increase cardinality of our metrics, and isn't very useful for
monitoring and filtering. To work around this, we enforce a whitelist
containing a few suffixes we actually care about. Suffixes not supported
will be grouped under the action without a suffix. This means that a
request to "FooController#bar.jpeg" will be assigned to
"FooController#bar".
2018-06-20 14:35:04 +02:00
Yorick Peterse 61ae9c4c5b
Adjust SQL and transaction Prometheus buckets
This allows us to better calculate Apdex scores, instead of having to
use the 0.1 and 1.0 buckets.
2018-06-11 19:18:02 +02:00
Yorick Peterse 33af33d7cb
Fix GPM content types for Doorkeeper
Certain controllers (e.g. Doorkeeper::TokensController) don't expose the
method "request_format". This commit changes
Gitlab::Metrics::WebTransaction so we don't rely on this method, instead
using the underlying code this method uses.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/46412
2018-05-16 12:53:54 +02:00
Yorick Peterse c003337729
Fix setting Gitlab metrics content types
The method "content_type" on a controller does not always return the
correct content type. On the other hand, the method "request_format"
does _and_ immediately returns a Symbol (e.g. :json) instead of a
mime-type name (e.g. application/json). With these changes metrics
should again report their action names correctly.

Fixes https://gitlab.com/gitlab-com/infrastructure/issues/3499
2018-05-15 17:38:39 +02:00
Stan Hu 204af2e101 Support resetting of Prometheus metrics between test runs
Adding the :prometheus tag to an rspec test will clear out
memory-mapped files and reset the registry.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39968
2018-05-09 14:33:42 -07:00
Stan Hu 05e1cbc4ca Move Sidekiq exporter logs to log/sidekiq_exporter.log
The Sidekiq exporter logs were mixing with the normal Sidekiq logs. In order
to support structured logging in Sidekiq, we either need to split this data
out or convert the exporter to produce structured logs. Since Sidekiq job
processing is fundamentally different information from Web server traffic,
it seems cleaner to move the metrics traffic into a separate file, where they
can be parsed by a different filter if needed.

Relates to #20060
2018-04-02 08:58:17 -07:00
Stan Hu 02d2a789d2 Fix "A copy of Gitlab::Metrics::Methods" have been removed error
Closes #44365
2018-03-16 12:05:39 -07:00
Stan Hu 3b3615f0b7 Guard against nil Sidekiq metrics server
Closes #41351
2018-02-20 21:47:55 -08:00
Pawel Chojnacki 50c9ba43f8 Only use features for events 2018-02-20 14:06:12 +01:00
Pawel Chojnacki 93c0a168ab Put all event metrics exposed to prometheus behind a feature flag 2018-02-20 13:29:05 +01:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Pawel Chojnacki d4c768ce09 Rename Concern -> Methods 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 098cf7d257 add comment aabout hotspots 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 75b49298f7 remove unused (?) variables 2018-01-29 15:13:05 +01:00
Pawel Chojnacki ffac08d290 Use class variables for metrics provider cache 2018-01-29 15:13:05 +01:00
Pawel Chojnacki a760445f9b fix typo in the buckets 2018-01-29 15:13:05 +01:00
Pawel Chojnacki b1ba8eb9a2 Do not use include Gitlab::CurrentSettings unnecessarily 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 1ac96603e1 Let mutex be initialized only once 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 05373c2490 Fix wrong histograam buckets 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 1c403459ca Add missing feature gate for cpu metrics 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 938d9ffe40 Refactor metrics to use metrics dsl notation 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 7d716cc849 Convert InfluxDB to concern. Fix uninitialized metrics when metrics code is inherited. 2018-01-29 15:13:04 +01:00
Pawel Chojnacki ea6196d490 Move prometheus metrics to module. Use class instance variables for metrics and metrics cache in metrics concern 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 27359dbf22 use class variable for Mutex instead of Const 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 83ae172145 Cleanup rspec 2018-01-29 15:13:04 +01:00
Pawel Chojnacki f5383578d9 NullMetric as a singleton 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 3e898be8aa Avoid cascading locking 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 6ff9f028fd Migrate and reduce the buckets of Gitaly metrics
/cc @bjk-gitlab
/cc @zj
2018-01-29 15:13:04 +01:00
Pawel Chojnacki 67fcd0610c Test if feature is respected 2018-01-29 15:13:04 +01:00
Pawel Chojnacki e3fe65543b Add Tests for Metrics::Concern 2018-01-29 15:13:04 +01:00
Pawel Chojnacki d7edc4b46b Use Global Mutex, and class instance variables using
```
          metric = @_metrics_provider_cache&.[](name)
          return metric if metric
``
acccessor that only slightly slower (<20ns) than direct class variable access
2018-01-29 15:13:03 +01:00
Pawel Chojnacki 087c9a5e8f Fix rubocop warnings 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 0325c23732 Fix tests 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 91a991367e Convert active record 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 66c2a3a83e Fix helper methods and document metric builder options 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 5328584b1e Reduce cardinality and convert some metrics to new scheme 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 62ef34cb40 Put View instrumentation and transaction memory use behind feature 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 66c1acba0b Fix code after refactoring 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 53f818fdac Refactor method concern to use hashes 2018-01-29 15:13:03 +01:00
Pawel Chojnacki e56b3d180d Refactor transaction metrics 2018-01-29 15:13:03 +01:00
Pawel Chojnacki d97548daa8 cleanup method call 2018-01-29 15:13:03 +01:00
Pawel Chojnacki e5d6141541 Actually make the new methods work 2018-01-29 15:13:03 +01:00
Pawel Chojnacki ef44fef15f Initiaal implementation of metrics concern 2018-01-29 15:13:03 +01:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Oswaldo Ferreira 64c6a8ae6e Use Concurrent::AtomicReference instead AtomicFixnum 2017-12-26 17:23:12 -02:00
Douwe Maan 92e15071c1 Merge branch 'pawel/reduce_cardinality_of_prometheus_metrics' into 'master'
Reduce cardinality of some of GitLab's Prometheus metrics and fix observed duration reporting.

Closes #41045

See merge request gitlab-org/gitlab-ce!15881
2017-12-21 15:56:45 +00:00
Pawel Chojnacki 040167f072 Use seconds where possible, and convert to milliseconds for Influxdb consumption 2017-12-21 00:39:52 +01:00
Pawel Chojnacki ed715b7926 use in_milliseconds rails helper 2017-12-20 17:49:43 +01:00
Pawel Chojnacki 3c545133e8 Fix tests and formatting 2017-12-19 17:45:25 +01:00
Lin Jen-Shin 59ac184fcf Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (671 commits)
  Make rubocop happy
  Use guard clause
  Improve language
  Prettify
  Use temp branch
  Pass info about who started the job and which job triggered it
  Docs: add indexes for monitoring and performance monitoring
  clearer-documentation-on-inline-diffs
  Add docs for commit diff discussion in merge requests
  sorting for tags api
  Clear BatchLoader after each spec to prevent holding onto records longer than necessary
  Include project in BatchLoader key to prevent returning blobs for the wrong project
  moved lfs_blob_ids method into ExtractsPath module
  Converted JS modules into exported modules
  spec fixes
  Bump gitlab-shell version to 5.10.3
  Clear caches before updating MR diffs
  Use new Ruby version 2.4 in GitLab QA images
  moved lfs blob fetch from extractspath file
  Update GitLab QA dependencies
  ...
2017-12-15 17:14:26 +08:00
Pawel Chojnacki 51668d3e1f Use class variable and add rubocop exception 2017-12-12 23:45:32 +01:00
Pawel Chojnacki da19ce625b Expire feature flag cache after 1minute 2017-12-12 18:52:08 +01:00
Pawel Chojnacki fd0a516854 use class variables instead of CONSTANTs 2017-12-12 18:38:28 +01:00
Pawel Chojnacki ca176a9bfe move call_measurement_enabled? method to the bottom of the file 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 408208bc2b Use AtomicFixNum to implement CAS isolated cache update.
i.e.
Using compare and swap we update the expires_at value.
The thread that actually is able to update this value will also set
the cache holding method_call enabled state
2017-12-12 18:38:28 +01:00
Pawel Chojnacki 5904b033db Implemente measurement enabled cache using AtomicReference 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 6af849644d Set cache expire only once the cache is filled,
to avoid situation where old result is returned in parallel thread.
2017-12-12 18:38:28 +01:00
Pawel Chojnacki b503e6ff42 Implement simple in memory cache that expires after 5 minutes 2017-12-12 18:38:28 +01:00
Pawel Chojnacki 53dc9e83c3 Cache feature check for 5 minutes for MethodCall instrumentation toggle 2017-12-12 18:38:28 +01:00
Pawel Chojnacki a8ebed6016 Make `System.monotonic_time` retun seconds represented by float with microsecond precision 2017-12-12 18:12:49 +01:00
Pawel Chojnacki e391fe1d6d Reduce cardinality of gitlab_cache_operation_duration_seconds histogram 2017-12-12 15:11:34 +01:00
Stan Hu 10f5446c33 Remove RubySampler#sample_objects for performance as well 2017-12-11 06:55:59 -08:00
Stan Hu e1a8e5a509 Remove allocation tracking code from InfluxDB sampler for performance
On GitLab.com, InfluxSampler#sample_objects appears to take 1.2 s or so to
iterate through 1059 objects. This had led to delays of a couple hundred
milliseconds in processing in the main thread. Remove this code since it's not
really being used.

Closes gitlab-com/infrastructure#3250
2017-12-10 21:53:28 -08:00
Pawel Chojnacki ee22a47d62 Update prometheus-client-mmap gem to highly optimized version
+ change string concatenation to help with GC pressure.
+ fix metric producing incompatible label sets
2017-12-07 17:47:23 +01:00
Lin Jen-Shin 85be6d83be Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (170 commits)
  support ordering of project notes in notes api
  Redirect to an already forked project if it exists
  Reschedule the migration to populate fork networks
  Create fork networks for forks for which the source was deleted.
  Fix item name and namespace text overflow in Projects dropdown
  Minor backport from EE
  fix link that was linking to `html` instead of `md`
  Backport epic tasklist
  Add timeouts for Gitaly calls
  SSHUploadPack over Gitaly is now OptOut
  fix icon colors in commit list
  Fix star icon color/stroke
  Backport border inline edit
  Add checkboxes to automatically run AutoDevops pipeline
  BE for automatic pipeline when enabling Auto DevOps
  I am certainly weary of debugging sidekiq but I don't think that's what was meant
  Ensure MRs always use branch refs for comparison
  Fix issue comment submit button disabled on GFM paste
  Lock seed-fu at the correct version in Gemfile.lock
  Improve indexes on merge_request_diffs
  ...
2017-11-30 15:20:00 +08:00
Pawel Chojnacki 46cd2d93bb Use feature flag instead of application settigns to control if method calls should be instrumented 2017-11-23 23:39:10 +01:00
Pawel Chojnacki 0051b5fbcc Use only real duration to measure method call performance via Prometheus 2017-11-23 23:33:01 +01:00
Pawel Chojnacki efe4cab92b check method timing threshold when observing method performance 2017-11-23 23:33:01 +01:00
Pawel Chojnacki 9884c0f4a0 Reenable prometheus metrics 2017-11-23 23:33:00 +01:00
Pawel Chojnacki cdcbeaccbe Move prometheus middle ware to prometheus initialized. 2017-11-23 23:32:55 +01:00
Pawel Chojnacki bf77f1cd10 Force disable Prometheus metrics
Until https://gitlab.com/gitlab-org/prometheus-client-mmap/merge_requests/11
is ready, Prometheus metrics will not work and cause issues such as #40457.
2017-11-22 10:57:02 -08:00
Lin Jen-Shin 663593e87e Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (126 commits)
  Update VERSION to 10.3.0-pre
  Update CHANGELOG.md for 10.2.0
  default fill color for SVGs
  ignore hashed repos (for now) when using `rake gitlab:cleanup:repos`
  Use Redis cache for branch existence checks
  Update CONTRIBUTING.md: Link definition of done to criteria
  Use `make install` for Gitaly setups in non-test environments
  FileUploader should check for hashed_storage?(:attachments) to use disk_path
  Set the default gitlab-shell timeout to 3 hours
  Update composite pipelines index to include "id"
  Use arrays in Pipeline#latest_builds_with_artifacts
  Fix blank states using old css
  Skip confirmation user api
  Custom issue tracker
  Revert "check for `read_only?` first before seeing if request is disallowed"
  add `#with_metadata` scope to remove a N+1 from the notes' API
  Fix promoting milestone updating all issuables without milestone
  Batchload blobs for diff generation
  check for `read_only?` first before seeing if request is disallowed
  use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
  ...
2017-11-22 17:07:01 +08:00
Lin Jen-Shin 07d3d44775 Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
2017-11-22 17:06:57 +08:00
Lin Jen-Shin 9ac0c76b78 Use StrongMemoize and enable/disable cops properly 2017-11-18 01:01:53 +08:00
Lin Jen-Shin 0af35d7e30 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (507 commits)
  Add dropdowns documentation
  Convert migration to populate latest merge request ID into a background migration
  Set 0.69.0 instead of latest for codeclimate image
  De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb
  Update database_debugging.md
  Update database_debugging.md
  Move installation of apps higher
  Change to Google Kubernetes Cluster and add internal links
  Add Ingress description from official docs
  Add info on creating your own k8s cluster from the cluster page
  Add info about the installed apps in the Cluster docs
  Resolve "lock/confidential issuable sidebar custom svg icons iteration"
  Update HA README.md to clarify GitLab support does not troubleshoot DRBD.
  Update license_finder to 3.1.1
  Make sure NotesActions#noteable returns a Noteable in the update action
  Cache the number of user SSH keys
  Adjust openid_connect_spec to use `raise_error`
  Resolve "Clicking on GPG verification badge jumps to top of the page"
  Add changelog for container repository path update
  Update container repository path reference
  ...
2017-11-17 19:19:06 +08:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
micael.bergeron 7fd3ce417f Revert "add metrics tagging to the sidekiq middleware"
This reverts commit d5859bb9d5.
This reverts commit 2b7e03cf69.
This reverts commit 7799a9bc44.
2017-11-08 16:21:08 -05:00
Pawel Chojnacki 90edcb45cd Make BackgroundTransaction#labels public
as are all other Transaction implementations
2017-11-07 19:23:52 +01:00
Grzegorz Bizon 4da03e9977 Merge branch 'pawel/metrics-to-prometheus-33643' into 'master'
Add all InfluxDB metrics to prometheus

See merge request gitlab-org/gitlab-ce!13891
2017-11-06 21:17:24 +00:00
Lin Jen-Shin fc6aad0b44 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (1723 commits)
  Resolve "Editor icons"
  Refactor issuable destroy action
  Ignore routes matching legacy_*_redirect in route specs
  Gitlab::Git::RevList and LfsChanges use lazy popen
  Gitlab::Git::Popen can lazily hand output to a block
  Merge branch 'master-i18n' into 'master'
  Remove unique validation from external_url in Environment
  Expose `duration` in Job API entity
  Add TimeCop freeze for DST and Regular time
  Harcode project visibility
  update a changelog
  Put a condition to old migration that adds fast_forward column to MRs
  Expose project visibility as CI variable
  fix flaky tests by removing unneeded clicks and focus actions
  fix flaky test in gfm_autocomplete_spec.rb
  Use Gitlab::Git operations for repository mirroring
  Encapsulate git operations for mirroring in Gitlab::Git
  Create a Wiki Repository's raw_repository properly
  Add `Gitlab::Git::Repository#fetch` command
  Fix Gitlab::Metrics::System#real_time and #monotonic_time doc
  ...
2017-11-06 21:44:57 +08:00
Rémy Coutable 5799e00f8f Fix Gitlab::Metrics::System#real_time and #monotonic_time doc 2017-11-03 17:12:05 +00:00
Pawel Chojnacki 5a085dc126 Add missing mutex guard to method call metrics 2017-11-03 12:37:08 +01:00
Pawel Chojnacki c9f0070b64 Make subscriber tests pass, after refactoring metrics 2017-11-02 18:18:16 +01:00
Pawel Chojnacki a300787fa9 Use Mutex to guard metrics creation in transaction. Switch action view to threadsafe instance variables 2017-11-02 18:18:16 +01:00
Pawel Chojnacki 67b3e3d84a move metrics for ActiveRecord, RailsCache and queue duration to instance variables 2017-11-02 18:18:16 +01:00
Pawel Chojnacki 735365a367 rename BackgroundMigration to SidekiqMigration 2017-11-02 18:18:16 +01:00
Pawel Chojnacki 30a4bb6628 Fix sidekiq middleware tests 2017-11-02 18:16:58 +01:00
Pawel Chojnacki 043545de3a Remove unnecessary namespace use 2017-11-02 18:11:44 +01:00
Pawel Chojnacki 534f6b1125 Tests for Web transaction and remove simple transacton 2017-11-02 18:11:44 +01:00
Pawel Chojnacki 929418da32 Web/Sidekiq transaction split 2017-11-02 18:11:44 +01:00
Pawel Chojnacki 99881bb7b0 Move labels to be initialized in constructor 2017-11-02 18:11:44 +01:00
Pawel Chojnacki 77e938a8f9 Avoid using Send (but is it better?) + small rubocop cleanup 2017-11-02 18:11:44 +01:00
Pawel Chojnacki 19634c259d Cleanup metrics names and removing unnecessary cache read total 2017-11-02 18:11:44 +01:00
Pawel Chojnacki c361c1e857 Adjust test to changed metrics methods.
+ remove deprecated test suite
2017-11-02 18:11:44 +01:00
Pawel Chojnacki 44eedb22bc Add info about prometheus buckets
+ fix cpu time
2017-11-02 18:11:44 +01:00
Pawel Chojnacki b4dbc30616 Guard metrics creation with a mutex 2017-11-02 18:11:44 +01:00
Pawel Chojnacki f64085e693 Move labels tests from Metrics rack spec to Transaction spec 2017-11-02 18:11:44 +01:00
Pawel Chojnacki b90bf88b14 Fix rspec errors, and add more tests to MethodCall and ActionView 2017-11-02 18:11:43 +01:00
Pawel Chojnacki 39ac6acbcc Fix Active record and transaction specs 2017-11-02 18:11:43 +01:00
Pawel Chojnacki 547dd817a5 Fix rubocop warnings 2017-11-02 18:11:43 +01:00
Pawel Chojnacki 4cf6be2be8 Differentiatie between class and instance methods 2017-11-02 18:11:43 +01:00
Pawel Chojnacki 815b8db1b9 Split call name to module and method name 2017-11-02 18:11:43 +01:00
Pawel Chojnacki cc7997d8d0 More parsable labels in method performance measurements 2017-11-02 18:11:43 +01:00
Pawel Chojnacki 43a9777e5e Make transaction labels more readable 2017-11-02 18:11:43 +01:00