Commit Graph

609 Commits

Author SHA1 Message Date
GitLab Bot e70cf9a659 Add latest changes from gitlab-org/gitlab@master 2021-02-18 00:09:31 +00:00
GitLab Bot b4e854a900 Add latest changes from gitlab-org/gitlab@master 2021-02-16 15:09:50 +00:00
GitLab Bot 8de5e388c6 Add latest changes from gitlab-org/gitlab@master 2021-02-10 03:09:31 +00:00
GitLab Bot 9ecdb93f4e Add latest changes from gitlab-org/gitlab@master 2021-02-01 12:09:03 +00:00
GitLab Bot 7e81076708 Add latest changes from gitlab-org/gitlab@master 2021-01-22 15:09:08 +00:00
GitLab Bot 39c1496527 Add latest changes from gitlab-org/gitlab@master 2021-01-13 12:10:27 +00:00
GitLab Bot 89d84b76a9 Add latest changes from gitlab-org/gitlab@master 2020-12-29 18:10:10 +00:00
GitLab Bot 4f0f7d5809 Add latest changes from gitlab-org/gitlab@master 2020-12-08 15:09:45 +00:00
GitLab Bot bbd9e2c915 Add latest changes from gitlab-org/gitlab@master 2020-12-03 15:09:46 +00:00
GitLab Bot 28f1931ae8 Add latest changes from gitlab-org/gitlab@master 2020-11-27 18:09:52 +00:00
GitLab Bot feb61d56e7 Add latest changes from gitlab-org/gitlab@master 2020-11-13 18:09:11 +00:00
GitLab Bot 038366a093 Add latest changes from gitlab-org/gitlab@master 2020-10-30 15:08:59 +00:00
GitLab Bot 06253b6c70 Add latest changes from gitlab-org/gitlab@master 2020-10-29 03:09:25 +00:00
GitLab Bot a683d38a36 Add latest changes from gitlab-org/gitlab@master 2020-10-26 18:08:27 +00:00
GitLab Bot bc12365ae0 Add latest changes from gitlab-org/gitlab@master 2020-10-20 09:08:43 +00:00
GitLab Bot 9c72b346ac Add latest changes from gitlab-org/gitlab@master 2020-10-15 09:08:41 +00:00
GitLab Bot a1e664d4cc Add latest changes from gitlab-org/gitlab@master 2020-10-12 06:08:53 +00:00
GitLab Bot 1850d48925 Add latest changes from gitlab-org/gitlab@master 2020-10-07 18:08:34 +00:00
GitLab Bot e72b53e81e Add latest changes from gitlab-org/gitlab@master 2020-10-02 18:08:56 +00:00
GitLab Bot dd240e5cc4 Add latest changes from gitlab-org/gitlab@master 2020-09-30 15:09:46 +00:00
GitLab Bot 34b3acb5a3 Add latest changes from gitlab-org/gitlab@master 2020-09-28 15:09:44 +00:00
GitLab Bot 7985071975 Add latest changes from gitlab-org/gitlab@master 2020-09-21 12:09:34 +00:00
GitLab Bot 708ee0bcb2 Add latest changes from gitlab-org/gitlab@master 2020-09-17 18:10:12 +00:00
GitLab Bot 0923a94d58 Add latest changes from gitlab-org/gitlab@master 2020-09-14 09:09:34 +00:00
GitLab Bot 537882ad40 Add latest changes from gitlab-org/gitlab@master 2020-09-10 00:08:32 +00:00
GitLab Bot 825e4190a3 Add latest changes from gitlab-org/gitlab@master 2020-09-09 15:08:47 +00:00
GitLab Bot 73add99b1f Add latest changes from gitlab-org/gitlab@master 2020-09-09 09:08:40 +00:00
GitLab Bot 49a897eff9 Add latest changes from gitlab-org/gitlab@master 2020-09-08 09:08:31 +00:00
GitLab Bot 4e06ca9e7d Add latest changes from gitlab-org/gitlab@master 2020-09-02 18:10:40 +00:00
GitLab Bot 2368893df7 Add latest changes from gitlab-org/gitlab@master 2020-08-31 15:10:41 +00:00
GitLab Bot eef9c80f1c Add latest changes from gitlab-org/gitlab@master 2020-08-27 15:10:21 +00:00
GitLab Bot 39a4ea6124 Add latest changes from gitlab-org/gitlab@master 2020-08-24 21:10:17 +00:00
GitLab Bot d5098d9fe3 Add latest changes from gitlab-org/gitlab@master 2020-08-21 15:10:03 +00:00
GitLab Bot 2f5731cf53 Add latest changes from gitlab-org/gitlab@master 2020-08-19 18:10:34 +00:00
GitLab Bot 7866b83bf4 Add latest changes from gitlab-org/gitlab@master 2020-08-19 09:09:58 +00:00
GitLab Bot bfce95a4c5 Add latest changes from gitlab-org/gitlab@master 2020-08-18 21:09:57 +00:00
GitLab Bot f10eb9ebae Add latest changes from gitlab-org/gitlab@master 2020-08-18 12:10:16 +00:00
GitLab Bot d8b613250b Add latest changes from gitlab-org/gitlab@master 2020-08-18 00:10:36 +00:00
GitLab Bot c787c1559e Add latest changes from gitlab-org/gitlab@master 2020-08-13 18:10:36 +00:00
GitLab Bot 6c516c90ef Add latest changes from gitlab-org/gitlab@master 2020-08-13 06:10:02 +00:00
GitLab Bot 999f47e9e6 Add latest changes from gitlab-org/gitlab@master 2020-08-12 12:10:25 +00:00
GitLab Bot 90156f527b Add latest changes from gitlab-org/gitlab@master 2020-08-12 06:09:53 +00:00
GitLab Bot da100a690f Add latest changes from gitlab-org/gitlab@master 2020-08-11 21:10:09 +00:00
GitLab Bot 9dde272671 Add latest changes from gitlab-org/gitlab@master 2020-08-11 15:10:08 +00:00
GitLab Bot 350fd8b878 Add latest changes from gitlab-org/gitlab@master 2020-08-10 18:09:54 +00:00
GitLab Bot 5958e399de Add latest changes from gitlab-org/gitlab@master 2020-08-07 12:09:59 +00:00
GitLab Bot 3c9c771dcf Add latest changes from gitlab-org/gitlab@master 2020-08-07 00:09:52 +00:00
GitLab Bot abf508470e Add latest changes from gitlab-org/gitlab@master 2020-08-06 03:10:05 +00:00
GitLab Bot 631ed6dcca Add latest changes from gitlab-org/gitlab@master 2020-08-06 00:09:53 +00:00
GitLab Bot af7f4b8c37 Add latest changes from gitlab-org/gitlab@master 2020-08-05 03:10:58 +00:00
GitLab Bot 14497073dc Add latest changes from gitlab-org/gitlab@master 2020-08-05 00:09:52 +00:00
GitLab Bot cb48c93abf Add latest changes from gitlab-org/gitlab@master 2020-08-03 09:09:42 +00:00
GitLab Bot 53758cb2ca Add latest changes from gitlab-org/gitlab@master 2020-08-01 00:09:45 +00:00
GitLab Bot 04338021ad Add latest changes from gitlab-org/gitlab@master 2020-07-31 18:09:37 +00:00
GitLab Bot ea937d0916 Add latest changes from gitlab-org/gitlab@master 2020-07-31 15:10:14 +00:00
GitLab Bot 73094cfac5 Add latest changes from gitlab-org/gitlab@master 2020-07-31 00:09:37 +00:00
GitLab Bot 5629d98f53 Add latest changes from gitlab-org/gitlab@master 2020-07-30 21:09:35 +00:00
GitLab Bot 55b5a8778c Add latest changes from gitlab-org/gitlab@master 2020-07-30 12:09:33 +00:00
GitLab Bot 6f9f4f0580 Add latest changes from gitlab-org/gitlab@master 2020-07-29 12:09:45 +00:00
GitLab Bot ed00b1a6a3 Add latest changes from gitlab-org/gitlab@master 2020-07-28 12:09:49 +00:00
GitLab Bot defde9698e Add latest changes from gitlab-org/gitlab@master 2020-07-23 09:09:18 +00:00
GitLab Bot 448ff1fb83 Add latest changes from gitlab-org/gitlab@master 2020-07-22 03:09:40 +00:00
GitLab Bot 651917dbac Add latest changes from gitlab-org/gitlab@master 2020-07-15 21:09:26 +00:00
GitLab Bot d91ff791fb Add latest changes from gitlab-org/gitlab@master 2020-07-14 03:09:24 +00:00
GitLab Bot c52b72f577 Add latest changes from gitlab-org/gitlab@master 2020-07-08 12:09:33 +00:00
GitLab Bot c417764f00 Add latest changes from gitlab-org/gitlab@master 2020-07-07 09:08:57 +00:00
GitLab Bot 691ed55a05 Add latest changes from gitlab-org/gitlab@master 2020-07-06 18:09:13 +00:00
GitLab Bot ce06ce825b Add latest changes from gitlab-org/gitlab@master 2020-07-06 15:08:42 +00:00
GitLab Bot 9fc7cdf0b7 Add latest changes from gitlab-org/gitlab@master 2020-07-06 12:09:00 +00:00
GitLab Bot 340f15b402 Add latest changes from gitlab-org/gitlab@master 2020-06-30 15:08:48 +00:00
GitLab Bot ad7ce32986 Add latest changes from gitlab-org/gitlab@master 2020-06-25 18:08:50 +00:00
GitLab Bot b7e512c897 Add latest changes from gitlab-org/gitlab@master 2020-06-23 12:09:20 +00:00
GitLab Bot 60082b335c Add latest changes from gitlab-org/gitlab@master 2020-06-19 21:08:32 +00:00
GitLab Bot 874c603d7a Add latest changes from gitlab-org/gitlab@master 2020-06-18 15:08:45 +00:00
GitLab Bot 292d054661 Add latest changes from gitlab-org/gitlab@master 2020-06-16 00:08:33 +00:00
GitLab Bot 6ff3eb60e3 Add latest changes from gitlab-org/gitlab@master 2020-06-09 15:08:05 +00:00
GitLab Bot 810bd2a662 Add latest changes from gitlab-org/gitlab@master 2020-06-02 12:08:33 +00:00
GitLab Bot 8c826685ec Add latest changes from gitlab-org/gitlab@master 2020-06-02 09:08:01 +00:00
GitLab Bot 9c3e48166e Add latest changes from gitlab-org/gitlab@master 2020-05-28 03:08:08 +00:00
GitLab Bot 707c0eca50 Add latest changes from gitlab-org/gitlab@master 2020-05-22 06:08:41 +00:00
GitLab Bot 59accb4c47 Add latest changes from gitlab-org/gitlab@master 2020-05-20 00:08:20 +00:00
GitLab Bot 95ab36cd97 Add latest changes from gitlab-org/gitlab@master 2020-05-15 21:08:21 +00:00
GitLab Bot e2d4a6dedb Add latest changes from gitlab-org/gitlab@master 2020-05-14 00:07:47 +00:00
GitLab Bot 868e4e69bb Add latest changes from gitlab-org/gitlab@master 2020-05-13 15:08:23 +00:00
GitLab Bot 0e65189f85 Add latest changes from gitlab-org/gitlab@master 2020-05-13 09:08:37 +00:00
GitLab Bot f35a7a3b8e Add latest changes from gitlab-org/gitlab@master 2020-05-07 15:09:29 +00:00
GitLab Bot 73886079f3 Add latest changes from gitlab-org/gitlab@master 2020-05-06 18:09:38 +00:00
GitLab Bot 0d09054d16 Add latest changes from gitlab-org/gitlab@master 2020-05-05 15:09:42 +00:00
GitLab Bot 3795b229ab Add latest changes from gitlab-org/gitlab@master 2020-05-01 00:09:59 +00:00
GitLab Bot c6acc1681a Add latest changes from gitlab-org/gitlab@master 2020-04-23 12:09:46 +00:00
GitLab Bot af5fb16f2a Add latest changes from gitlab-org/gitlab@master 2020-04-22 09:09:36 +00:00
GitLab Bot b7c735c8ac Add latest changes from gitlab-org/gitlab@master 2020-04-15 12:09:18 +00:00
GitLab Bot 75ee59f7a1 Add latest changes from gitlab-org/gitlab@master 2020-04-13 12:10:03 +00:00
GitLab Bot de2fb5b82c Add latest changes from gitlab-org/gitlab@master 2020-04-10 15:09:50 +00:00
GitLab Bot 060c842402 Add latest changes from gitlab-org/gitlab@master 2020-04-08 00:09:30 +00:00
GitLab Bot f3b1e07903 Add latest changes from gitlab-org/gitlab@master 2020-04-06 15:10:04 +00:00
GitLab Bot 6f2065c468 Add latest changes from gitlab-org/gitlab@master 2020-03-25 15:07:47 +00:00
GitLab Bot 074d013e1e Add latest changes from gitlab-org/gitlab@master 2020-03-23 15:09:36 +00:00
GitLab Bot 652bd07373 Add latest changes from gitlab-org/gitlab@master 2020-03-19 12:09:33 +00:00
GitLab Bot 2af90cef2e Add latest changes from gitlab-org/gitlab@master 2020-03-19 09:09:27 +00:00
GitLab Bot 77d15aff0e Add latest changes from gitlab-org/gitlab@master 2020-03-19 00:09:27 +00:00
GitLab Bot aaf5961054 Add latest changes from gitlab-org/gitlab@master 2020-03-18 15:09:45 +00:00
GitLab Bot c9687bdf58 Add latest changes from gitlab-org/gitlab@master 2020-03-11 12:09:26 +00:00
GitLab Bot 1fa79760ad Add latest changes from gitlab-org/gitlab@master 2020-03-10 12:08:16 +00:00
GitLab Bot 72721699f1 Add latest changes from gitlab-org/gitlab@master 2020-02-18 00:09:20 +00:00
GitLab Bot cf1d4237a4 Add latest changes from gitlab-org/gitlab@master 2020-02-15 21:08:49 +00:00
GitLab Bot e144369009 Add latest changes from gitlab-org/gitlab@master 2020-02-14 00:09:07 +00:00
GitLab Bot 0ab47b994c Add latest changes from gitlab-org/gitlab@master 2020-02-13 15:08:52 +00:00
GitLab Bot bd497e352e Add latest changes from gitlab-org/gitlab@master 2020-02-12 12:09:01 +00:00
GitLab Bot d87918510a Add latest changes from gitlab-org/gitlab@master 2020-02-06 09:09:06 +00:00
GitLab Bot be37a0ee5e Add latest changes from gitlab-org/gitlab@master 2020-01-30 09:08:55 +00:00
GitLab Bot 571d993b49 Add latest changes from gitlab-org/gitlab@master 2020-01-15 18:08:34 +00:00
GitLab Bot 6c15c18fa4 Add latest changes from gitlab-org/gitlab@master 2020-01-09 18:07:52 +00:00
GitLab Bot cddaddb86b Add latest changes from gitlab-org/gitlab@master 2020-01-09 12:08:03 +00:00
GitLab Bot 3ad11f24ca Add latest changes from gitlab-org/gitlab@master 2019-12-22 09:07:51 +00:00
GitLab Bot 898e2cc1df Add latest changes from gitlab-org/gitlab@master 2019-12-20 09:24:38 +00:00
GitLab Bot c2b98d3dbd Add latest changes from gitlab-org/gitlab@master 2019-12-17 15:08:15 +00:00
GitLab Bot badb9c1dea Add latest changes from gitlab-org/gitlab@master 2019-12-17 12:08:11 +00:00
GitLab Bot 9763c08170 Add latest changes from gitlab-org/gitlab@master 2019-12-17 03:07:45 +00:00
GitLab Bot 69d6d3ca20 Add latest changes from gitlab-org/gitlab@master 2019-12-16 21:08:00 +00:00
GitLab Bot 175b4fa261 Add latest changes from gitlab-org/gitlab@master 2019-12-11 18:08:10 +00:00
GitLab Bot 3269a20692 Add latest changes from gitlab-org/gitlab@master 2019-11-27 12:06:30 +00:00
GitLab Bot 3fc9a8e695 Add latest changes from gitlab-org/gitlab@master 2019-11-15 12:06:12 +00:00
GitLab Bot b42f312df5 Add latest changes from gitlab-org/gitlab@master 2019-11-13 21:06:45 +00:00
GitLab Bot 90a06a20be Add latest changes from gitlab-org/gitlab@master 2019-11-07 15:06:33 +00:00
GitLab Bot 083d64c646 Add latest changes from gitlab-org/gitlab@master 2019-10-31 15:06:41 +00:00
GitLab Bot b539ac1d61 Add latest changes from gitlab-org/gitlab@master 2019-10-30 09:27:58 +00:00
GitLab Bot 664c4c7b49 Add latest changes from gitlab-org/gitlab@master 2019-10-21 12:06:14 +00:00
GitLab Bot 184c2ced07 Add latest changes from gitlab-org/gitlab@master 2019-10-17 18:08:05 +00:00
GitLab Bot 6b75320f52 Add latest changes from gitlab-org/gitlab@master 2019-10-17 12:07:33 +00:00
GitLab Bot 8e45d25f7d Add latest changes from gitlab-org/gitlab@master 2019-10-16 18:08:01 +00:00
GitLab Bot 00c78fb814 Add latest changes from gitlab-org/gitlab@master 2019-10-16 15:06:17 +00:00
GitLab Bot d2ffc30fd5 Add latest changes from gitlab-org/gitlab@master 2019-10-16 12:06:32 +00:00
GitLab Bot 914ea32e0e Add latest changes from gitlab-org/gitlab@master 2019-10-16 09:07:51 +00:00
GitLab Bot 3546e1bb09 Add latest changes from gitlab-org/gitlab@master 2019-10-16 06:07:06 +00:00
GitLab Bot 31040b5bfe Add latest changes from gitlab-org/gitlab@master 2019-10-07 15:05:59 +00:00
GitLab Bot 185f428fa5 Add latest changes from gitlab-org/gitlab@master 2019-10-07 12:06:18 +00:00
GitLab Bot 1f1bdf54e1 Add latest changes from gitlab-org/gitlab@master 2019-10-04 09:06:35 +00:00
GitLab Bot 535d167d40 Add latest changes from gitlab-org/gitlab@master 2019-10-04 06:06:05 +00:00
GitLab Bot 6d60f91076 Add latest changes from gitlab-org/gitlab@master 2019-10-02 21:06:22 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Jacopo f599862e6c
Remove feature flags starting with `prometheus_transaction_`
Those feature flags were always enabled so we can remove them safely.
2019-09-05 11:01:02 +02:00
dineshpanda e908e11776 Avoid calling freeze on already frozen strings in lib/gitlab 2019-09-04 09:52:02 +05:30
Aleksei Lipniagov b4d62471f1 Improve GC_REPORT_BUCKETS granularity 2019-09-03 15:00:34 +03:00
Sarah Yasonik caa361b703 Support query parameters in metrics embeds
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971

Adds support for embedding specific charts from the
metrics dashboard. Expected parameters are dashboard,
title, group, and y_label.
2019-08-15 21:38:29 +00:00
Aleksei Lipniagov 6fc7033725 Remove :puma_phase metrics
We don't use phase restarts, as we use `preload_app`:
https://github.com/puma/puma/blob/master/README.md#clustered-mode
`:puma_phase` values will always be zero.
2019-08-14 17:46:40 +03:00
Sarah Yasonik bf918b68f6 Support dashboard params for metrics dashboard
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971

Adds support to EnvironmentsController#metrics_dashboard
for the following params: group, title, y_label
These params are used to uniquely identify a panel on
the metrics dashboard.

Metrics are stored in several places, so this adds
utilities to find a specific panel from the database
or filesystem depending on the metric specified.

Also moves some shared utilities into separate classes,
notably default values and errors.
2019-08-07 16:17:35 +00:00
Aleksei Lipniagov 1f9edb7c4a Call `GC::Profiler.clear` only in one place
Previously, both InfluxSampler and RubySampler were relying on the
`GC::Profiler.total_time` data which is the sum over the list
of captured GC events. Also, both samplers asynchronously called
`GC::Profiler.clear` which led to incorrect metric data because
each sampler has the wrong assumption it is the only object who calls
`GC::Profiler.clear` and thus could rely on the gathered results between
such calls.

We should ensure that `GC::Profiler.total_time` is called only in one
place making it possible to rely on accumulated data between such wipes.

Also, we need to track the amount of profiler reports we lost.
2019-08-02 09:04:32 +00:00
Sarah Yasonik dfe13131d7 Move BaseService to Services directory
In preparation for embedding specific metrics in issues
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971,
this commit moves the BaseService for metrics dashboards
to a new services subdirectory. This is purely for the sake
of organization and maintainability.
2019-07-29 23:03:59 +00:00
Aleksei Lipniagov 911c0f61b3 Remove :livesum from RubySampler metrics 2019-07-23 15:26:52 +03:00
Aleksei Lipniagov 4029d8b41c Get rid of `worker_label` in RubySampler
We have Prometheus::PidProvider which sets correct worker id for a
process, so such implementation of `worker_label` in the sampler is
obsolete.
2019-07-19 16:55:32 +03:00
Ben Kochie 442f599177 Adjust redis cache metrics
* Remove `controller` and `action` labels from duration histogram.
* Create a new simple counter for `controller` and `action`.
* Adjust histogram buckets to observe smaller response times.
2019-07-19 13:34:04 +00:00
Ryan Cobb 8f07620bc1 Remove unused method 2019-07-11 18:25:43 +00:00
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00
Sarah Yasonik 7d393bd852 Expose metrics element for FE consumption
Adds GFM Pipline filters to insert a placeholder in the generated
HTML from GFM based on the presence of a metrics dashboard link.

The front end should look for the class 'js-render-metrics' to
determine if it should replace the element with metrics charts.
The data element 'data-dashboard-url' should be the endpoint
the front end should hit in order to obtain a dashboard layout
in order to appropriately render the charts.
2019-07-10 11:27:25 +00:00
Kamil Trzciński 580368c09b Make unicorn_workers to return meaningful results 2019-07-09 16:06:15 +02:00
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