# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.0] - 2025-08-01

- FEATURE: Added puma_busy_threads metric that provides a holistic view of server workload by calculating (active threads - idle threads) + queued requests
- FEATURE: adding marking_time and sweeping_time to GC metrics
- DEV: bumped up minimum Ruby version to 3.2
- FIX: better handling of malformed metrics
- FIX: get controller labels from controller, not params
- DEV: expose close on runner instance
- FEATURE: improved puma metrics

## [2.2.0] - 2024-12-05

### Added

- Feature: Add Dalli::Client memcache metrics for web_collector

### Fixed

- FIX: Ensure socket is closed when error is raised while opening socket

## [2.1.1] - 2024-06-19

### Added

- FEATURE: improve good_job instrumentation
- FEATURE: imstrumentation for malloc / oldmalloc increace in GC stats

### Fixed

- FIX: improve Ruby 3.X support

## [2.1.0] - 2024-01-08

### Added

- FEATURE: good_job instrumentation

### Changed

- PERF: improve performance of histogram
- DEV: use new metric collector pattern so we reuse code between collectors

## [2.0.8] - 2023-01-20

### Added

- FEATURE: attempting to make our first docker release

## [2.0.7] - 2023-01-13

### Added
- FEATURE: allow binding server to both ipv4 and v6

### Fixed

- FIX: expire stale sidekiq metrics


## [2.0.6] - 2022-11-22

### Fixed

- FIX: use user specified labels over default in merge conflict
- FIX: sidekiq stats collector memory leak

## [2.0.5] - 2022-11-15

### Fixed

- FIX: regression :prepend style instrumentation not working correctly

## [2.0.4] - 2022-11-10

### Fixed

- FIX support for Redis 5 gem instrumentation

## [2.0.3] - 2022-05-23

### Added

- FEATURE: new ping endpoint for keepalive checks

### Fixed

- FIX: order histogram correctly for GCP support
- FIX: improve sidekiq instrumentation

## [2.0.2] - 2022-02-25

### Fixed

- FIX: runner was not requiring unicorn integration correctly leading to a crash

## [2.0.1] - 2022-02-24

### Fixed

- FIX: ensure threads do not leak when calling #start repeatedly on instrumentation classes, this is an urgent patch for Puma integration

## [2.0.0] - 2022-02-18

### Added

- FEATURE: Add per worker custom labels
- FEATURE: support custom histogram buckets

### Fixed

- FIX: all metrics are exposing status label, and not only `http_requests_total`

### Changed

- BREAKING: rename all `http_duration` metrics to `http_request_duration` to match prometheus official naming conventions (See https://prometheus.io/docs/practices/naming/#metric-names).

## [1.0.1] - 2021-12-22

### Added

- FEATURE: add labels to preflight requests
- FEATURE: SidekiqStats metrics

### Fixed

- FIX: mintor refactors to Sidekiq metrics

## [1.0.0] - 2021-11-23

### Added

- FEATURE: Sidekiq process metrics
- FEATURE: Allow collecting web metrics as histograms

### Fixed

- FIX: logger improved for web server
- FIX: Remove job labels from DelayedJob queues

### Changed

- BREAKING: rename metrics to match prometheus official naming conventions (See https://prometheus.io/docs/practices/naming/#metric-names)


## [0.8.1] - 2021-08-04

### Added

- FEATURE: swap from hardcoded STDERR to logger pattern (see README for details)

## [0.8.0] - 2021-07-05

### Added

- FEATURE: add job_name and queue_name labels to delayed job metrics
- FEATURE: always scope puma metrics on hostname in collector
- FEATURE: add customizable labels option to puma collector
- FEATURE: support for Resque
- FEATURE: Improve Active Record instrumentation
- FEATURE: Support HTTP_X_AMZN_TRACE_ID when supplied

### Fixed

- FIX: handle ThreadError more gracefully in cases where process shuts down
- FIX: Add source location to MethodProfiler patches

### Removed

- DEV: Remove support for EOL ruby 2.5

## [0.7.0] - 2020-12-29

### Added

- FEATURE: clean pattern for overriding middleware labels was introduced (in README)

### Fixed

- Fix: Better support for forking

### Changed

- Dev: Removed support from EOL rubies, only 2.5, 2.6, 2.7 and 3.0 are supported now.
- Dev: Better support for Ruby 3.0, explicitly depending on webrick
- Dev: Rails 6.1 instrumentation support

## [0.6.0] - 2020-11-17

### Added

- FEATURE: add support for basic-auth in the prometheus_exporter web server

## [0.5.3] - 2020-07-29

### Added

- FEATURE: added #remove to all metric types so users can remove specific labels if needed

## [0.5.2] - 2020-07-01

### Added

- FEATURE: expanded instrumentation for sidekiq
- FEATURE: configurable default labels

## [0.5.1] - 2020-02-25

### Added

- FEATURE: Allow configuring the default client's host and port via environment variables

## [0.5.0] - 2020-02-14

### Fixed

- FIX: Avoid calling `hostname` aggressively, instead cache it on the exporter instance

### Changed

- Breaking change: listen only to localhost by default to prevent unintended insecure configuration

## [0.4.17] - 2020-01-13

### Added

- FEATURE: add support for `to_h` on all metrics which can be used to query existing key/values

## [0.4.16] - 2019-11-04

### Added

- FEATURE: Support #reset! on all metric types to reset a metric to default

## [0.4.15] - 2019-11-04

### Added

- FEATURE: Improve delayed job collector, add pending counts
- FEATURE: New ActiveRecord collector (documented in readme)
- FEATURE: Allow passing in histogram and summary options
- FEATURE: Allow custom labels for unicorn collector

## [0.4.14] - 2019-09-10

### Added

- FEATURE: allow finding metrics by name RemoteMetric #find_registered_metric

### Fixed

- FIX: guard socket closing

## [0.4.13] - 2019-07-09

### Fixed

- Fix: Memory leak in unicorn and puma collectors

## [0.4.12] - 2019-05-30

### Fixed

- Fix: unicorn collector reporting incorrect number of unicorn workers

## [0.4.11] - 2019-05-15

### Fixed

- Fix: Handle stopping nil worker_threads in Client

### Changed

- Dev: add frozen string literals

## [0.4.10] - 2019-04-29

### Fixed

- Fix: Custom label support for puma collector
- Fix: Raindrops socket collector not working correctly

## [0.4.9] - 2019-04-11

### Fixed

- Fix: Gem was not working correctly in Ruby 2.4 and below due to a syntax error

## [0.4.8] - 2019-04-10

### Added

- Feature: added helpers for instrumenting unicorn using raindrops

## [0.4.7] - 2019-04-08

### Fixed

- Fix: collector was not escaping " \ and \n correctly. This could lead
  to a corrupt payload in some cases.

## [0.4.6] - 2019-04-02

### Added

- Feature: Allow resetting a counter
- Feature: Add sidekiq metrics: restarted, dead jobs counters

### Fixed

- Fix: Client shutting down before sending metrics to collector

## [0.4.5] - 2019-02-14

### Added

- Feature: Allow process collector to ship custom labels for all process metrics

### Fixed

- Fix: Always scope process metrics on hostname in collector

## [0.4.4] - 2019-02-13

### Added

- Feature: add support for local metric collection without using HTTP

## [0.4.3] - 2019-02-11

### Added

- Feature: Add alias for Gauge #observe called #set, this makes it a bit easier to migrate from prom
- Feature: Add increment and decrement to Counter

## [0.4.2] - 2018-11-30

### Fixed

- Fix: setting a Gauge to nil will remove Gauge (setting to non numeric will raise)

## [0.4.0] - 2018-10-23

### Added

- Feature: histogram support
- Feature: custom quantile support for summary
- Feature: Puma metrics

### Fixed

- Fix: delayed job metrics

## [0.3.4] - 2018-10-02

### Fixed

- Fix: custom collector via CLI was not working correctly

## [0.3.3]

### Added

- Feature: Add more metrics to delayed job collector

## [0.3.2]

### Added

- Feature: Add posibility to set custom_labels on multi process mode

## [0.3.1]

### Changed

- Allow runner to accept a --timeout var
- Allow runner to accept a blank prefix

## [0.3.0]

### Changed

- Breaking change: Follow Prometheus metric [naming conventions](https://prometheus.io/docs/practices/naming/#metric-names)

## [0.1.15] - 2018-02-19

### Added

- Feature: Prefer to use oj if it is loadable

## [0.1.14] - 2018-02-17

### Added

- Feature: runner was extracted so it can be reused @304

### Fixed

- Fix: error when shipping summary metric with no labels
