Skip to content

Commit 8740786

Browse files
authored
Merge pull request #252 from prometheus/sinjo-prepare-4-0
Prepare release 4.0.0
2 parents e2afbe7 + 05823a8 commit 8740786

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,39 @@
44

55
_None outstanding_
66

7+
# 4.0.0 / 2022-03-27
8+
9+
_**Codename:** The "barely a release" release_
10+
11+
This version contains a single - sadly breaking - change.
12+
13+
- [#251](https://github.com/prometheus/client_ruby/pull/251) Remove framework-specific
14+
route detection from collector middleware:
15+
In 3.0.0 [we shipped](https://github.com/prometheus/client_ruby/issues/245) a feature
16+
that attempted to use framework-specific information to determine the path of the
17+
request in `Prometheus::Middleware::Collector`.
18+
19+
Sadly, we found out after shipping it that it was prone to multiple issues. We spent
20+
a decent amount of time looking into them in depth, and came to the conclusion that
21+
there wasn't any reasonable way to fix them - the issues are inherent to the feature.
22+
23+
For a full, detailed write-up of our investigation, see [this
24+
comment](https://github.com/prometheus/client_ruby/issues/249#issuecomment-1061317511).
25+
26+
Almost all users will be unaffected by this change, but it is breaking per the
27+
definition we've used for previous releases, so we've erred on the side of caution and
28+
bumped the major version to communicate that.
29+
30+
If you use Sinatra or Grape with the `Prometheus::Middleware::Collector`, you will
31+
notice different `path` labels being generated. If not, this release will change
32+
nothing for you.
33+
34+
If you want the behaviour from 3.0.0 - or any custom path label generation you'd
35+
prefer - we've updated [our collector middleware
36+
documentation](https://github.com/prometheus/client_ruby/blob/master/examples/rack/README.md#collector).
37+
38+
**This may be a breaking change**. Labels may change in existing metrics.
39+
740
# 3.0.0 / 2022-02-05
841

942
This new major version includes some breaking changes. They should be reasonably easy to

UPGRADING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# Upgrading from 3.x.x to 4.x.x
2+
3+
## Objectives
4+
5+
4.0.0 contains a single breaking change - the [removal
6+
of](https://github.com/prometheus/client_ruby/pull/251) [framework-specific route
7+
detection](https://github.com/prometheus/client_ruby/pull/245) from
8+
`Prometheus::Middleware::Collector`.
9+
10+
## Removal of framework-specific route detection
11+
12+
In 3.0.0 we added a feature that used specific information provided by the Sinatra and
13+
Grape web frameworks to generate the `path` label in `Prometheus::Middleware::Collector`.
14+
15+
This feature turned out to be inherently flawed, due to limitations in the information we
16+
can extract from the request environment. [This
17+
comment](https://github.com/prometheus/client_ruby/issues/249#issuecomment-1061317511)
18+
goes into much more depth on the investigation we did and the conclusions we came to.
19+
20+
Most users will be unaffected by this change. If you use Sinatra or Grape and
21+
`Prometheus::Middleware::Collector` you will notice that your `path` label values will be
22+
much more similar to the ones we generated in the 2.x.x release series.
23+
124
# Upgrading from 2.x.x to 3.x.x
225

326
## Objectives

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 = '3.0.0'
5+
VERSION = '4.0.0'
66
end
77
end

0 commit comments

Comments
 (0)