openfeature-go-feature-flag-provider 0.1.4 → 0.1.5

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: 06fbdcc3c614c61afbea2daf01673e32ec2e6a3ce6fb61cca3b38974fb8610e3
4
- data.tar.gz: 8334fe12234af1b4d074f132a0b16cd96b418d33c94f35b3bf6c369a5864f9a3
3
+ metadata.gz: 732134fec225e4be0564e96bd987f237626269064192544bc5dda5b6b3c870ee
4
+ data.tar.gz: 9419134aad278f0179805d64b2143ed51b735c14141be5a4d3bd92042b71c9a8
5
5
  SHA512:
6
- metadata.gz: af3f930d2479b0d288034825d4bb69699b9c340136b69dd2186b79eb6a4c710a660e7b4ae2cf1a1b1f284a17f7ec1ae97c92f11c7690110342e33671a7136f57
7
- data.tar.gz: 473b42bf836ac156e4f8f7204ad25c20c391dcb07a6e5c46b82d4c420f80a2962872831da456528ec73a7620d12c011392cce0efef331721b8ccbdc56815be43
6
+ metadata.gz: df6d7ca639d9c1e77eeb2efa0f4cd296766ead410354c4e8c8f89895e0910901062e6ee7def51656c00956c5411c9526d4b572b1b0270332846c42de2e7756ff
7
+ data.tar.gz: bf98ef5871adf51d32118912db5ff9300fe14a666770e511e2ebab4ed4c326af8250722e2081e69fa770635ccb3f6d87b31853281f28a9c39b1a36c73a5ac0a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.5](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-go-feature-flag-provider/v0.1.4...openfeature-go-feature-flag-provider/v0.1.5) (2025-11-04)
4
+
5
+
6
+ ### ✨ New Features
7
+
8
+ * **goff:** add Faraday instrumentation ([#62](https://github.com/open-feature/ruby-sdk-contrib/issues/62)) ([6ae223f](https://github.com/open-feature/ruby-sdk-contrib/commit/6ae223f3ffa076a45581f454cffbc49a0394d871))
9
+
3
10
  ## [0.1.4](https://github.com/open-feature/ruby-sdk-contrib/compare/openfeature-go-feature-flag-provider/v0.1.3...openfeature-go-feature-flag-provider/v0.1.4) (2025-07-30)
4
11
 
5
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openfeature-go-feature-flag-provider (0.1.4)
4
+ openfeature-go-feature-flag-provider (0.1.5)
5
5
  faraday-net_http_persistent (~> 2.3)
6
6
  openfeature-sdk (~> 0.3.1)
7
7
 
data/README.md CHANGED
@@ -45,11 +45,11 @@ gem install openfeature-go-feature-flag-provider
45
45
 
46
46
  The `OpenFeature::GoFeatureFlag::Provider` needs some options to be created and then set in the OpenFeature SDK.
47
47
 
48
- | **Option** | **Description** |
49
- |------------|---------------------------------------------------------------------------------------------------------------------------------------------|
50
- | `endpoint` | **(mandatory)** The URL to access to the relay-proxy.<br />*(example: `https://relay.proxy.gofeatureflag.org/`)* |
51
- | `headers` | A `Hash` object containing the headers to send to the relay-proxy.<br/>*(example to send APIKey: `{"Authorization" => "Bearer my-api-key"}` |
52
-
48
+ | **Option** | **Description** |
49
+ |-------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
50
+ | `endpoint` | **(mandatory)** The URL to access to the relay-proxy.<br />*(example: `https://relay.proxy.gofeatureflag.org/`)* |
51
+ | `headers` | A `Hash` object containing the headers to send to the relay-proxy.<br/>*(example to send APIKey: `{"Authorization" => "Bearer my-api-key"}` |
52
+ | `instrumentation` | [Faraday instrumentation](https://github.com/lostisland/faraday/blob/main/docs/middleware/included/instrumentation.md) hash |
53
53
  The only required option to create a `GoFeatureFlagProvider` is the URL _(`endpoint`)_ to your GO Feature Flag relay-proxy instance.
54
54
 
55
55
  ```ruby
@@ -10,7 +10,7 @@ module OpenFeature
10
10
  def initialize(options: Options.new)
11
11
  @metadata = SDK::Provider::ProviderMetadata.new(name: PROVIDER_NAME)
12
12
  @options = options
13
- @goff_api = GoFeatureFlagApi.new(endpoint: options.endpoint, custom_headers: options.custom_headers)
13
+ @goff_api = GoFeatureFlagApi.new(endpoint: options.endpoint, custom_headers: options.custom_headers, instrumentation: options.instrumentation)
14
14
  end
15
15
 
16
16
  def fetch_boolean_value(flag_key:, default_value:, evaluation_context: nil)
@@ -11,8 +11,9 @@ module OpenFeature
11
11
  module GoFeatureFlag
12
12
  # This class is the entry point for the GoFeatureFlagProvider
13
13
  class GoFeatureFlagApi
14
- def initialize(endpoint: nil, custom_headers: nil)
14
+ def initialize(endpoint: nil, custom_headers: nil, instrumentation: nil)
15
15
  @faraday_connection = Faraday.new(url: endpoint, headers: headers(custom_headers)) do |f|
16
+ f.request :instrumentation, instrumentation if instrumentation
16
17
  f.adapter :net_http_persistent do |http|
17
18
  http.idle_timeout = 30
18
19
  end
@@ -6,13 +6,15 @@ module OpenFeature
6
6
  module GoFeatureFlag
7
7
  # This class is the configuration class for the GoFeatureFlagProvider
8
8
  class Options
9
- attr_accessor :endpoint, :custom_headers, :exporter_metadata
9
+ attr_accessor :endpoint, :custom_headers, :exporter_metadata, :instrumentation
10
10
 
11
- def initialize(endpoint: nil, headers: {}, exporter_metadata: {})
11
+ def initialize(endpoint: nil, headers: {}, exporter_metadata: {}, instrumentation: nil)
12
12
  validate_endpoint(endpoint: endpoint)
13
+ validate_instrumentation(instrumentation: instrumentation)
13
14
  @endpoint = endpoint
14
15
  @custom_headers = headers
15
16
  @exporter_metadata = exporter_metadata
17
+ @instrumentation = instrumentation
16
18
  end
17
19
 
18
20
  private
@@ -25,6 +27,13 @@ module OpenFeature
25
27
  rescue URI::InvalidURIError
26
28
  raise ArgumentError, "Invalid URL for endpoint: #{endpoint}"
27
29
  end
30
+
31
+ def validate_instrumentation(instrumentation: nil)
32
+ return if instrumentation.nil?
33
+ return if instrumentation.is_a?(Hash)
34
+
35
+ raise ArgumentError, "Invalid type for instrumentation: #{instrumentation.class}"
36
+ end
28
37
  end
29
38
  end
30
39
  end
@@ -1,5 +1,5 @@
1
1
  module OpenFeature
2
2
  module GoFeatureFlag
3
- GO_FEATURE_FLAG_PROVIDER_VERSION = "0.1.4"
3
+ GO_FEATURE_FLAG_PROVIDER_VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openfeature-go-feature-flag-provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Poignant
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-30 00:00:00.000000000 Z
11
+ date: 2025-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openfeature-sdk