Commit Graph

288 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 9deca0d90c
DEV: Fix the broken CI build 2024-12-05 07:46:36 +08:00
Uzzal Devkota 66c1f39b72
Update README.md - Add metrics setup instructions for puma single mode (#311) 2024-04-09 13:40:43 +10:00
Konstantin Ilchenko e23bac5471
FIX: kwargs patching (#313)
Amends method profiler patching to use Ruby 3.0 patterns and enforces Ruby 3.0 and up.
2024-04-03 11:18:10 +11:00
Nicolas Rodriguez d1724827d9
Reuse exisint logger to log start banner instead of puts method (#304)
Lower log level too so the message is logged
2024-01-31 07:57:53 +11:00
Brent Dearth f54709a56b
feat(process): support malloc / oldmalloc increase bytes limit GC stat (#305) 2024-01-31 07:53:01 +11:00
Pieter C 239e2c60f9
Fix Github Actions workflow for publish_docker (#303) 2024-01-29 14:43:42 +11:00
Sam 83a89798e7
Version bump (#299)
Also cleans up some linting and gets the test suite to pass 

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2024-01-08 09:49:46 +11:00
Michael Smith e763dc696c
Add missing good_job require (#294) 2023-11-17 10:33:32 +11:00
Dawid Janczak 27df0a6229
Remove post install message (#288)
v0.5 has been released in 2020, we probably don't need this message
anymore.
2023-08-01 11:36:40 +10:00
martinramirez7 d2653a2e53
Feature: add latency to delayed job metrics (#285) 2023-07-26 11:11:20 +10:00
Jonathan Stern 7344d37ffd
DEV: Actually fix broken readme toc link (#287)
In #286, I attempted to fix a broken readme TOC link, but I didn't check the result closely and left it still broken 🤦 The correct anchor is `histogram---custom-buckets` (3 hyphens).
2023-07-24 17:58:11 +02:00
Jonathan Stern e152108451
PERF: use reverse_each for cheaper histogram bucket filling (#286)
* use reverse_each for cheaper histogram bucket filling
* fix readme histogram custom buckets toc link
2023-07-24 09:48:13 +10:00
Anders Mikkelsen 8d77c53333
FEATURE: Added basic GoodJob collectors (#280) 2023-05-30 09:41:24 +10:00
Anders Mikkelsen 9ea664f91c
Use Rails.env.test? in README (#273) 2023-05-05 08:13:45 +08:00
Dan Sosedoff 4281f75f9f
Add note about request tracing with AWS LB (#279) 2023-05-03 11:44:54 +10:00
Dan Sosedoff ad0f37ed24
Expand usage of MetricsContainer in other collectors (#268)
* Update activerecord collector
* Add extra AR collector test
* Add expiration test for resque collector
* Add process collector test file
* Adds the basic process collection tests (individually for the collector class)
* Fixes hostname collection (hostname was previously ignored, see #272 for details)
* Add unicorn collector test
2023-03-30 09:08:51 +11:00
Dan Sosedoff 8db6dc1612
Fix docker image publishing workflow (#270) 2023-03-03 09:35:46 +00:00
Dan Sosedoff e8186520a8
Include hostname into ActiveRecord metrics (#272)
* Include hostname into ActiveRecord metrics

* Disable rubocop debugger rule on a placeholder collector
2023-02-17 10:53:13 +11:00
Sam dd38011b1b
Version bump (#269)
For docker release
2023-01-19 23:53:52 -05:00
Dan Sosedoff e5ec9ac55d
Add dockerfile (#267)
* Add dockerfile

* Update dockerfile and add docker image release workflow

* Add readme for docker usage

* Swap Docker Hub for Github Container Registry
2023-01-20 15:33:47 +11:00
Dan Sosedoff 78e48d6ed3
Test on Ruby 3.2 (#266) 2023-01-17 15:25:45 +11:00
Sam 44c624acc4
Version bump (#265) 2023-01-16 12:57:02 +11:00
Dan Sosedoff 394b6980ff
Add ability to filter out duplicate data in metrics container (#263) 2023-01-13 14:37:56 +11:00
Dan Sosedoff e4e2413ad1
Handle stale sidekiq queue and process metrics (#262)
* Handle stale sidekiq queue and process metrics

* Refactor sidekiq collectors to use metrics container with auto-expiration of data

* Fix linting issues

* Clarify wrap_expire method
2023-01-04 16:31:34 +11:00
Dan Sosedoff 700cf2c5be
Allow binding server to both ipv4/ipv6 interfaces (#260)
* Allow binding server to both ipv4/ipv6 interfaces
* Add mention of -b option values to readme
* Allow ANY/ALL as an value to bind option
2022-12-29 11:56:26 +11:00
Sam a4b09bc958
version bump (#258) 2022-11-22 11:24:31 +11:00
Tristan Starck 446c612689
use specified labels over default labels in merge conflicts (#257) 2022-11-18 10:38:02 +11:00
Marcel Puchol cd0908e0a9
FIX: sidekiq stats collector memory leak (#256) 2022-11-16 16:32:03 +11:00
Sam 43af64b69d
Release new version (#255) 2022-11-15 13:58:29 +11:00
Kuya Kohara 2a436ef529
Fix MethodProfiler to preserve the target class behavior (#254)
* Fix MethodProfiler to preserve the target class behavior

* Fix test to patch MethodProfiler at toplevel

Because it cannot be teared down.
2022-11-15 13:53:46 +11:00
Sam af30f7f874
Version bump (#251) 2022-11-10 12:33:19 +11:00
Sam 7f14c50afc
FIX: correct instrumentation for Redis 5 (#250)
Redis 5 gem introduces redis_client as the low level transport method

We no longer patch Redis gem if we detect it is version 5 and above and
instead use the supported middleware interface to patch it.

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2022-10-31 09:32:25 +11:00
Dmytro Budnyk 568fc04079
Fixes README navigation (#247) 2022-09-20 11:00:42 +10:00
Geoff Harcourt 8c8f4a5826
Update example custom collector to inherit from BaseCollector (#235)
The documentation advises that a custom collector should inherit from
`PrometheusExporter::Server::BaseCollector` and the example in the docs
does so. The code example inherits from `Collector` instead. We found
this seemed to work in development but would behave unreliably in
production. This change updates the example to match the code snippet in
the Readme.
2022-06-01 15:56:39 +10:00
Renato "Lond" Cerqueira 07ebf3eaf6
Fix merge in web collector (#232)
Following #216 changes, having a custom "status" metric was not
correctly merged resulting in errors in prometheus
2022-05-23 17:04:28 +10:00
Sam 39ee77b434
version bump and change log (#234) 2022-05-23 16:48:59 +10:00
Christoph Lupprich 35058bda70
Order histogram buckets small to large (#233)
This is per https://prometheus.io/docs/instrumenting/exposition_formats/#histograms-and-summaries, which says:

> The buckets of a histogram and the quantiles of a summary must appear in increasing numerical order of their label values (for the le or the quantile label, respectively).
2022-05-23 16:43:09 +10:00
Xiao Ba 0508f31a39
parse delayed name in death handler (#231)
Co-authored-by: Xiao Ba <root@git.x140.xyz>
2022-04-20 11:55:05 +10:00
Torri Lischka c46653d73e
Pass msg hash to Sidekiq jobs custom_labels function (#227)
* Pass msg hash to Sidekiq jobs custom_labels function

The hash only gets passed if the function expects > 0
arguments. This avoids a breaking change with the
previous version where a custom_labels function on a
worker class didn't take any arguments

* Fix weird formatting in collector test

* Add TODO to remove arity check after next major version
2022-03-22 15:51:08 +11:00
Benjamin Zimmer 958961efb6
add test case + fix for ruby 3 incompatibility (#230)
The exporters Sidekiq middleware is not Ruby >=3.0 compatible. The
commit adds a testcase and backwards compatible fix.
2022-03-10 17:22:48 +11:00
Nicolas Rodriguez 27a768932b
Add /ping endpoint which only returns PONG (#226) 2022-03-07 13:07:07 +11:00
Brad Charna 1cf7757d60
Ability to choose style of instrumentation (#228)
Allow consumers to choose how methods get patched for instrumentation (prepend vs alias_method). 

Default remains alias_method.
2022-03-02 11:25:39 +11:00
Sam 52e01d9349
FIX: unicorn instrumentation not required correctly (#225)
Runner.rb would crash due to only partially requiring unicorn
integration

Changes it so it is defer required
2022-02-25 14:19:30 +11:00
Sam e0d664b80c
Version bump (#221) 2022-02-24 11:49:30 +11:00
Sam f0167e02a9
FIX: ensure threads do not leak when #start is called (#219)
* FIX: ensure threads do not leak when #start is called

Periodic instrumentation now follows a general pattern where they
inherit from PeriodicStats.

This implementation ensures proper management of backing thread

1. All classes inheriting now have a .started? method to determine
if instrument is started

2. All classes implement a clean .stop method for stopping active
periodic instrumentation

3. Consumers of the class get to write less code repeat code due
to worker_loop
2022-02-24 11:34:39 +11:00
David Taylor 6099df5baa
Bump version to 2.0.0 (#217) 2022-02-18 09:32:18 +00:00
Torri Lischka 0460dacf5a
FEATURE: Add per worker custom labels (#208)
* Added per-worker custom labels to sidekiq metrics

If a worker class a a custom_labels method then its
return value will be merged with any global custom
labels and attached to its exported sidekiq metrics
2022-02-16 12:44:32 +11:00
Maxime Demolin 40865b012d
Do not include status label everywhere (#216)
* Do not include status label everywhere

The `status` label is included in every metrics, and not only in
`http_requests_total`, even though the README states that
```
All metrics have a `controller` and an `action` label.
`http_requests_total` additionally has a (HTTP response) `status` label.
```

This can be a problem as this `status` label can quickly increase the
cardinality of the metrics.

* Explicitly add label instead if removing it
2022-02-11 09:04:46 +11:00
Daniel Wojnar 226a5ac67d
FEATURE: support custom histogram buckets
`Histogram.default_buckets` can now be used to set default buckets for histograms if you prefer to set a global default.
2022-02-01 11:58:50 +11:00
Maxime Demolin 8d25304209
Rename metric http_duration_seconds (#211)
Official prometheus documentation refers to this metric as
`http_request_duration_seconds`.

See: https://prometheus.io/docs/practices/naming/#metric-names
2022-01-31 16:41:51 +11:00