Skip to content

Commit 9431ca2

Browse files
authored
Merge pull request #244 from prometheus/sinjo-release-3.0.0
Update CHANGELOG.md and gem version for 3.0.0 release
2 parents 57feffb + e213a71 commit 9431ca2

File tree

2 files changed

+127
-6
lines changed

2 files changed

+127
-6
lines changed

CHANGELOG.md

Lines changed: 126 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,135 @@
11
# CHANGELOG
22

3+
# Unreleased changes
4+
5+
_None outstanding_
6+
7+
# 3.0.0 / 2022-??-?? (TODO: edit commit to add date before merging)
8+
9+
This new major version includes some breaking changes. They should be reasonably easy to
10+
adapt to, but please read the details below:
11+
12+
## Breaking changes
13+
14+
Please refer to [UPGRADING.md](UPGRADING.md) for details on upgrading from versions
15+
`< 3.0.0`.
16+
17+
- [#206](https://github.com/prometheus/client_ruby/pull/206) Include `SCRIPT_NAME` when
18+
determining path in Collector:
19+
When determining the path for a request, `Rack::Request` prefixes the
20+
`SCRIPT_NAME`. This was a problem with our code when using mountable engines,
21+
where the engine part of the path gets lost. This patch fixes that to include `SCRIPT_NAME` as part of the path.
22+
23+
**This may be a breaking change**. Labels may change in existing metrics.
24+
25+
- [#245](https://github.com/prometheus/client_ruby/pull/206) Use framework-specific route
26+
info and handle consecutive path segments containing IDs in Collector:
27+
When generating the `path` label, we now use framework-specific information from the
28+
request environment to produce better labels for apps written in the Sinatra and Grape
29+
frameworks. Rails doesn't provide the information we need to do the same there, but we
30+
hope to get such functionality added in a future release.
31+
32+
Our framework-agnostic fallback (which Rails apps will use) has also been improved. It
33+
now supports stripping IDs/UUIDs from consecutive path segments, where previously only
34+
alternating segments would be correctly stripped.
35+
36+
**This may be a breaking change**. Labels may change in existing metrics.
37+
38+
- [#209](https://github.com/prometheus/client_ruby/pull/209) Automatically initialize metrics
39+
without labels.
40+
Following the [Prometheus Best Practices](https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics),
41+
client libraries are expected to automatically export a 0 value when declaring a metric
42+
that has no labels.
43+
We missed this recommendation in the past, and this wasn't happening. Starting from this
44+
version, all metrics without labels will be immediately exported with `0` value, without
45+
need for an increment / observation.
46+
47+
**This may be a breaking change**. Depending on your particular metrics, this may
48+
result in a significant increase to the number of time series being exported. We
49+
recommend you test this and make sure it doesn't cause problems.
50+
51+
- [#220](https://github.com/prometheus/client_ruby/pull/220) and [#234](https://github.com/prometheus/client_ruby/pull/234)
52+
Improvements to Pushgateway client:
53+
- The `job` parameter is now mandatory when instantiating `Prometheus::Client::Push`
54+
and will raise `ArgumentError` if not specified, or if `nil` or an empty string/object
55+
are passed.
56+
- The `Prometheus::Client::Push` initializer now takes keyword arguments.
57+
- You can now pass a set of arbitrary key-value pairs (`grouping_key`) to uniquely
58+
identify a job instance, rather than just an `instance` label.
59+
- Fixed URI escaping of spaces in the path when pushing to to Pushgateway. In the
60+
past, spaces were being encoded as `+` instead of `%20`, which resulted in
61+
incorrect label values in the grouping key.
62+
- We now correctly encode special values in `job` and `grouping_key` that can't
63+
ordinarily be represented in the URL. This mean you can have a forward slash (`/`)
64+
in a grouping key label value, or set one to the empty string.
65+
- We validate that labels in your `grouping_key` don't clash with labels in the
66+
metrics being submitted, and raise an error if they do.
67+
- We raise an error on a non-2xx HTTP response from the Pushgateway.
68+
69+
**This is a breaking change if you use Pushgateway**. You will need to update your
70+
code to pass keyword arguments to the `Prometheus::Client::Push` initializer.
71+
72+
- [#242](https://github.com/prometheus/client_ruby/pull/242) Move HTTP Basic
73+
Authentication credentials in `Prometheus::Client::Push` to separate method call:
74+
In earlier versions, these were provided as part of the `gateway` URL, which had some
75+
significant downsides when it came to special characters in usernames/passwords.
76+
77+
These credentials must now be passed via an explicit call to `basic_auth` on an
78+
instance of `Prometheus::Client::Push`.
79+
80+
**This is a breaking change if you use Pushgateway with HTTP Basic Authentication**.
81+
You will need to update your code to call this method instead of including the
82+
credentials in the URL.
83+
84+
- [#236](https://github.com/prometheus/client_ruby/pull/236) Validate label names:
85+
Previously, we didn't validate that label names match the character set required by
86+
Prometheus (`[a-zA-Z_][a-zA-Z0-9_]*`). As of this release, we raise an error if a
87+
metric is initialized with label names that don't match that regex.
88+
89+
**This is a breaking change**. While it's likely that Prometheus server would have
90+
been failing to scrape metrics with such labels anyway, declaring them will now cause
91+
an error to be raised in your code.
92+
93+
- [#237](https://github.com/prometheus/client_ruby/pull/237) Drop support for old Ruby versions:
94+
Ruby versions below 2.6 are no longer supported upstream, and `client_ruby` is no
95+
longer tested against them.
96+
97+
**This may be a breaking change**. We no longer make efforts to ensure that
98+
`client_ruby` works on older versions, and any issues filed specific to them will be
99+
considered invalid.
100+
101+
## New Features
102+
103+
- [#199](https://github.com/prometheus/client_ruby/pull/199) Add `port` filtering option
104+
to Exporter middleware.
105+
You can now specify a `port` when adding `Prometheus::Middleware::Exporter` to your
106+
middleware chain, and metrics will only be exported if the `/metrics` request comes
107+
through that port.
108+
109+
- [#222](https://github.com/prometheus/client_ruby/pull/222) Enable configuring `Net::HTTP`
110+
timeouts for Pushgateway calls.
111+
You can now specify `open_timeout` and `read_timeout` when instantiating
112+
`Prometheus::Client::Push`, to control these timeouts.
113+
114+
## Code improvements and bug fixes
115+
116+
- [#201](https://github.com/prometheus/client_ruby/pull/201) Make all registry methods
117+
thread safe.
118+
119+
- [#227](https://github.com/prometheus/client_ruby/pull/227) Fix `with_labels` bug that
120+
made it completely non-functional, and occasionally resulted in `DirectFileStore` file
121+
corruption.
122+
123+
3124
# 2.1.0 / 2020-06-29
4125

5126
## New Features
6127

7-
- [#177](https://github.com/prometheus/client_ruby/pull/177) Added Histogram helpers to
128+
- [#177](https://github.com/prometheus/client_ruby/pull/177) Added Histogram helpers to
8129
generate linear and exponential buckets, as the Client Library Guidelines recommend.
9-
- [#172](https://github.com/prometheus/client_ruby/pull/172) Added :most_recent
130+
- [#172](https://github.com/prometheus/client_ruby/pull/172) Added :most_recent
10131
aggregation for gauges on DirectFileStore.
11-
132+
12133
## Code improvements
13134

14135
- Fixed several warnings that started firing in the latest versions of Ruby.
@@ -17,7 +138,7 @@
17138

18139
## Breaking changes
19140

20-
- [#176](https://github.com/prometheus/client_ruby/pull/176) BUGFIX: Values observed at
141+
- [#176](https://github.com/prometheus/client_ruby/pull/176) BUGFIX: Values observed at
21142
the upper limit of a histogram bucket are now counted in that bucket, not the following
22143
one. This is unlikely to break functionality and you probably don't need to make code
23144
changes, but it may break tests.
@@ -35,6 +156,6 @@
35156
- This release saw a number of breaking changes to better comply with latest best practices
36157
for naming and client behaviour. Please refer to [UPGRADING.md](UPGRADING.md) for details
37158
if upgrading from `<= 0.9`.
38-
159+
39160
- The main feature of this release was adding support for multi-process environments such
40161
as pre-fork servers (Unicorn, Puma).

lib/prometheus/client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Prometheus
44
module Client
5-
VERSION = '2.1.0'
5+
VERSION = '3.0.0'
66
end
77
end

0 commit comments

Comments
 (0)