govuk_app_config 4.6.3 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +5 -26
- data/CHANGELOG.md +4 -0
- data/govuk_app_config.gemspec +2 -2
- data/lib/govuk_app_config/govuk_prometheus_exporter.rb +28 -6
- data/lib/govuk_app_config/version.rb +1 -1
- data/lib/govuk_app_config.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0a86d04eac2f6c9d28dac8fe8971f2d9a7b318466145bed5d314eb0ce57529
|
4
|
+
data.tar.gz: f309aece319f90ddc1eeaee8ab30188121caec53e2d3f86e7236a38a54307952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e54af80454cb90fbf63f1b3b4b81ee89f7edf5adc589fb24f0fe3a16e232d6a6663d3c9d56870b6922e0907c2f8e36aa66f17942384ba2444e38158d164892a
|
7
|
+
data.tar.gz: 24223d4a1aca01eec6d2dba4f5a6bfe70d09135fb4d3504a0db77624bf3b8055d6c769446f3c6b8af95e311851952dc36ae58c37a870f1b228145dcc5726a7db
|
data/.github/workflows/ci.yml
CHANGED
@@ -24,33 +24,12 @@ jobs:
|
|
24
24
|
runs-on: ubuntu-latest
|
25
25
|
steps:
|
26
26
|
- run: echo "All matrix tests have passed 🚀"
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
publish:
|
29
29
|
needs: test
|
30
|
-
runs-on: ubuntu-latest
|
31
30
|
if: ${{ github.ref == 'refs/heads/main' }}
|
32
31
|
permissions:
|
33
32
|
contents: write
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
with:
|
38
|
-
rubygems: latest
|
39
|
-
- env:
|
40
|
-
GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
|
41
|
-
GEM_NAME: govuk_app_config
|
42
|
-
run: |
|
43
|
-
VERSION=$(ruby -e "puts eval(File.read('$GEM_NAME.gemspec')).version")
|
44
|
-
GEM_VERSION=$(gem list --exact --remote $GEM_NAME)
|
45
|
-
|
46
|
-
# Publish to RubyGems.org
|
47
|
-
if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
|
48
|
-
gem build $GEM_NAME.gemspec
|
49
|
-
gem push "$GEM_NAME-${VERSION}.gem"
|
50
|
-
fi
|
51
|
-
|
52
|
-
# Create a release tag
|
53
|
-
if ! git ls-remote --tags --exit-code origin v${VERSION}; then
|
54
|
-
git tag v${VERSION}
|
55
|
-
git push --tags
|
56
|
-
fi
|
33
|
+
uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yaml@main
|
34
|
+
secrets:
|
35
|
+
GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
|
data/CHANGELOG.md
CHANGED
data/govuk_app_config.gemspec
CHANGED
@@ -30,11 +30,11 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.add_development_dependency "byebug"
|
32
32
|
spec.add_development_dependency "climate_control"
|
33
|
-
spec.add_development_dependency "rack-test", "~>
|
33
|
+
spec.add_development_dependency "rack-test", "~> 2.0"
|
34
34
|
spec.add_development_dependency "rails", "~> 7"
|
35
35
|
spec.add_development_dependency "rake", "~> 13.0"
|
36
36
|
spec.add_development_dependency "rspec", "~> 3.10"
|
37
37
|
spec.add_development_dependency "rspec-its", "~> 1.3"
|
38
|
-
spec.add_development_dependency "rubocop-govuk", "4.
|
38
|
+
spec.add_development_dependency "rubocop-govuk", "4.6.0"
|
39
39
|
spec.add_development_dependency "webmock"
|
40
40
|
end
|
@@ -1,13 +1,35 @@
|
|
1
1
|
module GovukPrometheusExporter
|
2
|
+
def self.should_configure
|
3
|
+
ENV["GOVUK_PROMETHEUS_EXPORTER"] == "true" && !(defined?(Rails) && Rails.env == "test")
|
4
|
+
end
|
5
|
+
|
2
6
|
def self.configure
|
3
|
-
unless
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
+
return unless should_configure
|
8
|
+
|
9
|
+
require "prometheus_exporter"
|
10
|
+
require "prometheus_exporter/server"
|
11
|
+
require "prometheus_exporter/middleware"
|
12
|
+
|
13
|
+
if defined?(Sidekiq)
|
14
|
+
Sidekiq.configure_server do |config|
|
15
|
+
require "prometheus_exporter/instrumentation"
|
16
|
+
config.server_middleware do |chain|
|
17
|
+
chain.add PrometheusExporter::Instrumentation::Sidekiq
|
18
|
+
end
|
19
|
+
config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
|
20
|
+
config.on :startup do
|
21
|
+
PrometheusExporter::Instrumentation::Process.start(type: "sidekiq")
|
22
|
+
PrometheusExporter::Instrumentation::SidekiqProcess.start
|
23
|
+
PrometheusExporter::Instrumentation::SidekiqQueue.start
|
24
|
+
PrometheusExporter::Instrumentation::SidekiqStats.start
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
7
28
|
|
8
|
-
|
9
|
-
|
29
|
+
server = PrometheusExporter::Server::WebServer.new bind: "0.0.0.0", port: 9394
|
30
|
+
server.start
|
10
31
|
|
32
|
+
if defined?(Rails)
|
11
33
|
Rails.application.middleware.unshift PrometheusExporter::Middleware
|
12
34
|
end
|
13
35
|
end
|
data/lib/govuk_app_config.rb
CHANGED
@@ -6,9 +6,9 @@ require "govuk_app_config/govuk_i18n"
|
|
6
6
|
# This require is deprecated and should be removed on next major version bump
|
7
7
|
# and should be required by applications directly.
|
8
8
|
require "govuk_app_config/govuk_unicorn"
|
9
|
+
require "govuk_app_config/govuk_prometheus_exporter"
|
9
10
|
|
10
11
|
if defined?(Rails)
|
11
|
-
require "govuk_app_config/govuk_prometheus_exporter"
|
12
12
|
require "govuk_app_config/govuk_logging"
|
13
13
|
require "govuk_app_config/govuk_content_security_policy"
|
14
14
|
require "govuk_app_config/railtie"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstasher
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '2.0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '2.0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rails
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +212,14 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - '='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 4.
|
215
|
+
version: 4.6.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - '='
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 4.
|
222
|
+
version: 4.6.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: webmock
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
296
|
- !ruby/object:Gem::Version
|
297
297
|
version: '0'
|
298
298
|
requirements: []
|
299
|
-
rubygems_version: 3.3.
|
299
|
+
rubygems_version: 3.3.20
|
300
300
|
signing_key:
|
301
301
|
specification_version: 4
|
302
302
|
summary: Base configuration for GOV.UK applications
|