govuk_app_config 8.0.2 → 8.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +3 -0
- data/govuk_app_config.gemspec +4 -1
- data/lib/govuk_app_config/govuk_open_telemetry.rb +18 -0
- data/lib/govuk_app_config/govuk_prometheus_exporter.rb +1 -1
- data/lib/govuk_app_config/railtie.rb +4 -0
- data/lib/govuk_app_config/version.rb +1 -1
- data/lib/govuk_app_config.rb +1 -0
- metadata +48 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df59068ad0c6277dddb68a7c934e9557fc3e59db4a72022503c29942ca18fe1a
|
4
|
+
data.tar.gz: 691a810bf1793a069121d37a343c0fb955b7034bdf55166377ebe5454b60af6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0dba812e73f859cb79e379f80f05322836c402043849070539d75fbdc489e8e83270ae26adbe816b58eae7a2789ac83cf35581ef94b586bba53e6feb86a6f51
|
7
|
+
data.tar.gz: 9e4840809cdb83747be969f86c78de547d79c635e9e4eb83635e627f607b509b52689a2db66faf85ab11af99327877f9a45597465c8a50d629c2440b8fcc394d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 8.1.1
|
2
|
+
|
3
|
+
* Fix prometheus_exporter to method patching compatible with open telemetry.
|
4
|
+
|
5
|
+
# 8.1.0
|
6
|
+
|
7
|
+
* Add ability to enable Open Telemetry instrumentation for Rails applications.
|
8
|
+
|
1
9
|
# 8.0.2
|
2
10
|
|
3
11
|
* Fix the ability to collect Sidekiq metrics in GovukPrometheusExporter. ([#299](https://github.com/alphagov/govuk_app_config/pull/299))
|
data/README.md
CHANGED
@@ -104,6 +104,9 @@ end
|
|
104
104
|
|
105
105
|
`GovukError.configure` has the same options as the Sentry client, Raven. See [the Raven docs for all configuration options](https://docs.sentry.io/clients/ruby/config).
|
106
106
|
|
107
|
+
## Open Telemetry
|
108
|
+
|
109
|
+
To enable Open Telemetry instrumentation for Rails set the ENABLE_OPEN_TELEMETRY="true" environment variable.
|
107
110
|
|
108
111
|
## Prometheus monitoring
|
109
112
|
|
data/govuk_app_config.gemspec
CHANGED
@@ -21,6 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = %w[lib]
|
22
22
|
|
23
23
|
spec.add_dependency "logstasher", "~> 2.1"
|
24
|
+
spec.add_dependency "opentelemetry-exporter-otlp", "~> 0.25.0"
|
25
|
+
spec.add_dependency "opentelemetry-instrumentation-all", "~> 0.39.1"
|
26
|
+
spec.add_dependency "opentelemetry-sdk", "~> 1.2"
|
24
27
|
spec.add_dependency "plek", ">= 4", "< 6"
|
25
28
|
spec.add_dependency "prometheus_exporter", "~> 2.0"
|
26
29
|
spec.add_dependency "puma", ">= 5.6", "< 7.0"
|
@@ -36,6 +39,6 @@ Gem::Specification.new do |spec|
|
|
36
39
|
spec.add_development_dependency "rake", "~> 13.0"
|
37
40
|
spec.add_development_dependency "rspec", "~> 3.10"
|
38
41
|
spec.add_development_dependency "rspec-its", "~> 1.3"
|
39
|
-
spec.add_development_dependency "rubocop-govuk", "4.
|
42
|
+
spec.add_development_dependency "rubocop-govuk", "4.11.0"
|
40
43
|
spec.add_development_dependency "webmock"
|
41
44
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module GovukOpenTelemetry
|
2
|
+
def self.should_configure?
|
3
|
+
ENV["ENABLE_OPEN_TELEMETRY"] == "true"
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.configure(service_name)
|
7
|
+
return unless should_configure?
|
8
|
+
|
9
|
+
require "opentelemetry/sdk"
|
10
|
+
require "opentelemetry/exporter/otlp"
|
11
|
+
require "opentelemetry/instrumentation/all"
|
12
|
+
|
13
|
+
OpenTelemetry::SDK.configure do |config|
|
14
|
+
config.service_name = service_name
|
15
|
+
config.use_all # enables all instrumentation!
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -40,7 +40,7 @@ module GovukPrometheusExporter
|
|
40
40
|
server.start
|
41
41
|
|
42
42
|
if defined?(Rails)
|
43
|
-
Rails.application.middleware.unshift PrometheusExporter::Middleware
|
43
|
+
Rails.application.middleware.unshift PrometheusExporter::Middleware, instrument: :prepend
|
44
44
|
end
|
45
45
|
|
46
46
|
if defined?(Sinatra)
|
@@ -8,6 +8,10 @@ module GovukAppConfig
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
initializer "govuk_app_config.configure_open_telemetry" do |app|
|
12
|
+
GovukOpenTelemetry.configure(app.class.module_parent_name.underscore)
|
13
|
+
end
|
14
|
+
|
11
15
|
config.before_initialize do
|
12
16
|
GovukLogging.configure if Rails.env.production?
|
13
17
|
end
|
data/lib/govuk_app_config.rb
CHANGED
@@ -3,6 +3,7 @@ require "govuk_app_config/govuk_statsd"
|
|
3
3
|
require "govuk_app_config/govuk_error"
|
4
4
|
require "govuk_app_config/govuk_proxy/static_proxy"
|
5
5
|
require "govuk_app_config/govuk_healthcheck"
|
6
|
+
require "govuk_app_config/govuk_open_telemetry"
|
6
7
|
require "govuk_app_config/govuk_prometheus_exporter"
|
7
8
|
|
8
9
|
if defined?(Rails)
|
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: 8.
|
4
|
+
version: 8.1.1
|
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: 2023-
|
11
|
+
date: 2023-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstasher
|
@@ -24,6 +24,48 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: opentelemetry-exporter-otlp
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.25.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.25.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: opentelemetry-instrumentation-all
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.39.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.39.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: opentelemetry-sdk
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: plek
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,14 +280,14 @@ dependencies:
|
|
238
280
|
requirements:
|
239
281
|
- - '='
|
240
282
|
- !ruby/object:Gem::Version
|
241
|
-
version: 4.
|
283
|
+
version: 4.11.0
|
242
284
|
type: :development
|
243
285
|
prerelease: false
|
244
286
|
version_requirements: !ruby/object:Gem::Requirement
|
245
287
|
requirements:
|
246
288
|
- - '='
|
247
289
|
- !ruby/object:Gem::Version
|
248
|
-
version: 4.
|
290
|
+
version: 4.11.0
|
249
291
|
- !ruby/object:Gem::Dependency
|
250
292
|
name: webmock
|
251
293
|
requirement: !ruby/object:Gem::Requirement
|
@@ -295,6 +337,7 @@ files:
|
|
295
337
|
- lib/govuk_app_config/govuk_healthcheck/redis.rb
|
296
338
|
- lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
|
297
339
|
- lib/govuk_app_config/govuk_logging.rb
|
340
|
+
- lib/govuk_app_config/govuk_open_telemetry.rb
|
298
341
|
- lib/govuk_app_config/govuk_prometheus_exporter.rb
|
299
342
|
- lib/govuk_app_config/govuk_proxy/static_proxy.rb
|
300
343
|
- lib/govuk_app_config/govuk_puma.rb
|
@@ -321,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
364
|
- !ruby/object:Gem::Version
|
322
365
|
version: '0'
|
323
366
|
requirements: []
|
324
|
-
rubygems_version: 3.4.
|
367
|
+
rubygems_version: 3.4.15
|
325
368
|
signing_key:
|
326
369
|
specification_version: 4
|
327
370
|
summary: Base configuration for GOV.UK applications
|