README.md in unleash-5.0.3 vs README.md in unleash-5.0.4
- old
+ new
@@ -22,11 +22,11 @@
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'unleash', '~> 5.0.0'
+gem 'unleash', '~> 5.0.4'
```
And then execute:
$ bundle
@@ -42,13 +42,13 @@
- `app_name` with the name of the runninng application.
- `custom_http_headers` with `{'Authorization': '<API token>'}` when using Unleash v4.0.0 and later.
Please substitute the example `'https://unleash.herokuapp.com/api'` for the url of your own instance.
-### instance_id
+It is **highly recommended** to configure:
+- `instance_id` parameter with a unique identifier for the running instance.
-As of version 6.0.0, `instance_id` is now an automatically generated read-only property.
```ruby
Unleash.configure do |config|
config.app_name = 'my_ruby_app'
config.url = 'https://unleash.herokuapp.com/api'
@@ -82,10 +82,11 @@
Argument | Description | Required? | Type | Default Value|
---------|-------------|-----------|-------|---------------|
`url` | Unleash server URL. | Y | String | N/A |
`app_name` | Name of your program. | Y | String | N/A |
+`instance_id` | Identifier for the running instance of program. Important so you can trace back to where metrics are being collected from. **Highly recommended be be set.** | N | String | random UUID |
`environment` | Unleash context option. Could be for example `prod` or `dev`. Not yet in use. **Not** the same as the SDK's [Unleash environment](https://docs.getunleash.io/reference/environments). | N | String | `default` |
`project_name` | Name of the project to retrieve features from. If not set, all feature flags will be retrieved. | N | String | nil |
`refresh_interval` | How often the unleash client should check with the server for configuration changes. | N | Integer | 15 |
`metrics_interval` | How often the unleash client should send metrics to server. | N | Integer | 60 |
`disable_client` | Disables all communication with the Unleash server, effectively taking it *offline*. If set, `is_enabled?` will always answer with the `default_value` and configuration validation is skipped. Will also forcefully set `disable_metrics` to `true`. Defeats the entire purpose of using unleash, except when running tests. | N | Boolean | `false` |
@@ -139,18 +140,23 @@
```ruby
Unleash.configure do |config|
config.app_name = Rails.application.class.parent.to_s
config.url = 'https://unleash.herokuapp.com/api'
+ # config.instance_id = "#{Socket.gethostname}"
config.logger = Rails.logger
end
UNLEASH = Unleash::Client.new
# Or if preferred:
# Rails.configuration.unleash = Unleash::Client.new
```
+For `config.instance_id` use a string with a unique identification for the running instance.
+For example: it could be the hostname, if you only run one App per host.
+Or the docker container id, if you are running in docker.
+If it is not set the client will generate an unique UUID for each execution.
To have it available in the `rails console` command as well, also add to the file above:
```ruby
Rails.application.console do
UNLEASH = Unleash::Client.new
@@ -240,9 +246,10 @@
```ruby
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Unleash.configure do |config|
config.app_name = Rails.application.class.parent.to_s
+ # config.instance_id = "#{Socket.gethostname}"
config.logger = Rails.logger
config.url = 'https://unleash.herokuapp.com/api'
config.custom_http_headers = {'Authorization': '<API token>'}
end