govuk_app_config 8.0.2 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29a6672c834922901fdc98c77a61b43c12a3455ed1445419e3cc2132a52bd6a0
4
- data.tar.gz: b91182c0cb0bd09f95a34703e72271afc71479742e1e5177dd3310d8b7b0439e
3
+ metadata.gz: b3d7236b119d0f93a720288c9ca9ee559324fed80472261aa049472dcc7a11f4
4
+ data.tar.gz: 1803d31e9fa99656514c4c127ae9d230af8dd2eae95791432d547f8604575009
5
5
  SHA512:
6
- metadata.gz: 9a54c8f6c22ed6157735dfbbfebdd35b5d5264d9d972bfc705cf73429acb0afa5d60e162bda3202208a6d5f3a278c6a66de8d37ac02aca2b8f90994f58cd8e3a
7
- data.tar.gz: 22cc9d0cc5c942ae89f05e55dfcbf0a47f51d0a7c7fd3df7d10fdb255ff2e4e46a7b81f488f91080a2cb5077c0ebc4828a6a49b85083179dfa124408ca6cda57
6
+ metadata.gz: 1674b3b5655bf2fa492cbcd644eff15b3effe83fb504d5bd8f9428dfe404e1b2130626dbc88fa0b63674cd0313a8fa80b0592a61a547aa36f3984f5c2b837f27
7
+ data.tar.gz: 9676dea638fcad4895d510570a9cebf173a463cd65cc1190ec6e7029a2d521b343efd353bd1990bdbb50228d7a5eeddeda62289133c019a443d5115d31e84d66
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 8.1.0
2
+
3
+ * Add ability to enable Open Telemetry instrumentation for Rails applications.
4
+
1
5
  # 8.0.2
2
6
 
3
7
  * 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
 
@@ -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.10.0"
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "8.0.2".freeze
2
+ VERSION = "8.1.0".freeze
3
3
  end
@@ -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.0.2
4
+ version: 8.1.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: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2023-07-03 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.10.0
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.10.0
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.14
367
+ rubygems_version: 3.4.15
325
368
  signing_key:
326
369
  specification_version: 4
327
370
  summary: Base configuration for GOV.UK applications