contentful 2.18.0 → 2.19.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: 4c528da80cb5f6311e4777fb2e4df10669e4b68040999a897e56a6aa3175d93f
4
- data.tar.gz: fbdceb0c8f8529e5c2447835a1769e5e6f630dcd96b5b7262884e3213275782c
3
+ metadata.gz: 3f73573b5e007f3d6ef23b5d347f1d524a0c88e7e1ad90f044a20290b71eb1df
4
+ data.tar.gz: d9ba166255a82387acbea7127f665c4aedd5181b36f5dab67a6ddc6286d87876
5
5
  SHA512:
6
- metadata.gz: e754c6ff56a14421791b440a4003d128e69550b8c40d4913d86af91ac63070047ddc0ebdf99d5a1fd72a6605f950b3f030c0edf50c8ffa976fffe7934461ab61
7
- data.tar.gz: 7289773832ac258c0994d6e38dca5491d9c6954d788b3bb3fc904e24c0697a9789dd27a38957d893fbbc163dddfa9bb62c6a32b3f0b7b07a9be1e456c41f5ed4
6
+ metadata.gz: '0693f89bec3ad2bc4324b523fc6086260c26f0f48e20614df3005c8ae39d733915193ce7fe8f7698fe90c383610af030a8e18becd5ea4d8ae9dbb5dc0e6553d9'
7
+ data.tar.gz: aef73a49aad4da0757a2a2f8e013a46137e5bb6ebed392de2a3c916093b3a4ef96deabca8e33c1360c6eff9dd4b1edce58be4b18309cdd95934ba6ae0d5d28f2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.19.0
6
+ * Added `http_instrumenter` configuration option to allow instrumenting HTTP requests. [#266](https://github.com/contentful/contentful.rb/pull/266)
7
+ * Updated `http` gem version to `> 4`
8
+
5
9
  ## 2.18.0
6
10
  * Added support for Taxonomy endpoints
7
11
 
data/README.md CHANGED
@@ -369,6 +369,15 @@ client = Contentful::Client.new(
369
369
  the original log_level on the logger, for example when using Rails.logger.
370
370
  </td>
371
371
  </tr>
372
+ <tr>
373
+ <td><code>http_instrumenter</code></td>
374
+ <td><code>nil</code></td>
375
+ <td>
376
+ An HTTP instrumenter object that implements the <code>HTTP::Features::Instrumentation::Instrumenter</code> interface.
377
+ When provided, it will be used to instrument all HTTP requests made by the client.
378
+ This is useful for monitoring, logging, or tracking HTTP requests.
379
+ </td>
380
+ </tr>
372
381
  </tbody>
373
382
  </table>
374
383
 
@@ -44,16 +44,18 @@ module Contentful
44
44
  application_name: nil,
45
45
  application_version: nil,
46
46
  integration_name: nil,
47
- integration_version: nil
47
+ integration_version: nil,
48
+ http_instrumenter: nil
48
49
  }
49
50
 
50
51
  attr_reader :configuration, :logger, :proxy
51
52
 
52
53
  # Wraps the actual HTTP request via proxy
53
54
  # @private
54
- def self.get_http(url, query, headers = {}, proxy = {}, timeout = {})
55
+ def self.get_http(url, query, headers = {}, proxy = {}, timeout = {}, instrumenter)
55
56
  http = HTTP[headers]
56
57
  http = http.timeout(timeout) if timeout.any?
58
+ http = http.use(instrumentation: { instrumenter: instrumenter }) if instrumenter
57
59
  if proxy[:host]
58
60
  http.via(proxy[:host], proxy[:port], proxy[:username], proxy[:password]).get(url, params: query)
59
61
  else
@@ -92,6 +94,10 @@ module Contentful
92
94
  # @option given_configuration [String] :application_version
93
95
  # @option given_configuration [String] :integration_name
94
96
  # @option given_configuration [String] :integration_version
97
+ # @option given_configuration [HTTP::Features::Instrumentation::Instrumenter, nil] :http_instrumenter
98
+ # An HTTP instrumenter object that implements the instrumentation interface.
99
+ # When provided, it will be used to instrument all HTTP requests made by the client.
100
+ # This is useful for monitoring, logging, or tracking HTTP requests.
95
101
  def initialize(given_configuration = {})
96
102
  @configuration = default_configuration.merge(given_configuration)
97
103
  normalize_configuration!
@@ -410,7 +416,8 @@ module Contentful
410
416
  request_query(request.query),
411
417
  request_headers,
412
418
  proxy_params,
413
- timeout_params
419
+ timeout_params,
420
+ configuration[:http_instrumenter]
414
421
  ), request
415
422
  )
416
423
  end
@@ -1,5 +1,5 @@
1
1
  # Contentful Namespace
2
2
  module Contentful
3
3
  # Gem Version
4
- VERSION = '2.18.0'
4
+ VERSION = '2.19.0'
5
5
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (Jan Lelis)
8
8
  - Contentful GmbH (Andreas Tiefenthaler)
9
9
  - Contentful GmbH (David Litvak Bruno)
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2025-07-24 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: http
@@ -286,7 +285,6 @@ homepage: https://github.com/contentful/contentful.rb
286
285
  licenses:
287
286
  - MIT
288
287
  metadata: {}
289
- post_install_message:
290
288
  rdoc_options: []
291
289
  require_paths:
292
290
  - lib
@@ -301,8 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
299
  - !ruby/object:Gem::Version
302
300
  version: '0'
303
301
  requirements: []
304
- rubygems_version: 3.5.22
305
- signing_key:
302
+ rubygems_version: 3.6.7
306
303
  specification_version: 4
307
304
  summary: contentful
308
305
  test_files: []