govuk_app_config 9.15.8 → 9.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bed42866988f8750e1f1712d1c0c2dbdd721fe7f6fdb5f361d83ddebbedec6fa
4
- data.tar.gz: 3986ed5d06766b356da975a177772d4a148349ff84631498d1bde09b8d68322c
3
+ metadata.gz: fb44777e2f99d4cd18095e308a9f907bd870292c2c500f30ba36c4c3e23730ea
4
+ data.tar.gz: 8578bbd300c3febc4453c5ca199477aa15dfd014c16151980b9d052768601aa6
5
5
  SHA512:
6
- metadata.gz: c6bee275e972ecee41b8a1e006b0395d639c42620f0cb0598f6bf81dedb343b2a117e7eb2210d6ea3255d19900b1b65162f9385bb2c4f746d67d11aa9552c51d
7
- data.tar.gz: 94f618290095a93ca1d005bd5046177eed6c3ab655b1a061594ea3317476591a9283841f72f901068faa019a3ae41f1da6ad8bfc269d142b0f84b1b8952438a8
6
+ metadata.gz: 42b060b29d1138587a0c7078d2be9150c37238b06f158256e28c84054faf48e3aed652821d92a200440a6322da9b11dee666ed078c8df5d68891dff76d139551
7
+ data.tar.gz: 62145bed7d6c5a2235abae4f5f69c7b6eaa6b11f939975001e8f97231fbbf2c694c40bb982fb8597d6cae9e90678eb719bb1c2126cef72acb6a349438608343f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 9.16.0
2
+
3
+ * GovukPrometheus - custom labels from rack env ([#424](https://github.com/alphagov/govuk_app_config/pull/424))
4
+
1
5
  # 9.15.8
2
6
 
3
7
  * Update dependencies
@@ -4,13 +4,13 @@ require "prometheus_exporter/server"
4
4
  require "prometheus_exporter/middleware"
5
5
 
6
6
  module GovukPrometheusExporter
7
- #
8
- # See https://github.com/discourse/prometheus_exporter/pull/293
9
- #
10
- # RailsMiddleware can be removed and replaced with the default middleware if
11
- # that PR is merged / released
12
- #
13
7
  class RailsMiddleware < PrometheusExporter::Middleware
8
+ #
9
+ # See https://github.com/discourse/prometheus_exporter/pull/293
10
+ #
11
+ # default_labels can be removed and fall through to the base method if
12
+ # that PR is merged / released
13
+ #
14
14
  def default_labels(env, _result)
15
15
  controller_instance = env["action_controller.instance"]
16
16
  action = controller = nil
@@ -28,6 +28,10 @@ module GovukPrometheusExporter
28
28
  controller: controller || "other",
29
29
  }
30
30
  end
31
+
32
+ def custom_labels(env)
33
+ env.fetch("govuk.prometheus_labels", {})
34
+ end
31
35
  end
32
36
 
33
37
  class SinatraMiddleware < PrometheusExporter::Middleware
@@ -39,6 +43,10 @@ module GovukPrometheusExporter
39
43
  # the application / pod and don't provide any other labels
40
44
  {}
41
45
  end
46
+
47
+ def custom_labels(env)
48
+ env.fetch("govuk.prometheus_labels", {})
49
+ end
42
50
  end
43
51
 
44
52
  def self.should_configure
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "9.15.8".freeze
2
+ VERSION = "9.16.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.15.8
4
+ version: 9.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev