From f24578c639ab2b21d513a8b3fa4206bb5cb0cd4b Mon Sep 17 00:00:00 2001 From: uzair khan Date: Fri, 8 Nov 2024 13:50:52 +0530 Subject: [PATCH] docs(analytics): add setup instructions for currency_conversion service --- crates/analytics/docs/README.md | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/crates/analytics/docs/README.md b/crates/analytics/docs/README.md index 96218fc231c2..eb5c26a6ba3f 100644 --- a/crates/analytics/docs/README.md +++ b/crates/analytics/docs/README.md @@ -91,6 +91,44 @@ source = "kafka" After making this change, save the file and restart your application for the changes to take effect. +## Setting up Forex APIs + +To use Forex services, you need to sign up and get your API keys from the following providers: + +1. Primary Service + - Sign up for a free account and get your Primary API key [here](https://openexchangerates.org/). + - It will be in dashboard, labeled as `app_id`. + +2. Fallback Service + - Sign up for a free account and get your Fallback API key [here](https://apilayer.com/marketplace/exchangerate_host-api). + - It will be in dashboard, labeled as `access key`. + +### Configuring Forex APIs + +To configure the Forex APIs, update the `config/development.toml` or `config/docker_compose.toml` file with your API keys: + +```toml +[forex_api] +api_key = "YOUR API KEY HERE" # Replace the placeholder with your Primary API Key +fallback_api_key = "YOUR API KEY HERE" # Replace the placeholder with your Fallback API Key +``` +### Important Note +```bash +ERROR router::services::api: error: {"error":{"type":"api","message":"Failed to fetch currency exchange rate","code":"HE_00"}} +│ +├─▶ Failed to fetch currency exchange rate +│ +╰─▶ Could not acquire the lock for cache entry +``` + +_If you get the above error after setting up, simply remove the `redis` key `"{forex_cache}_lock"` by running this in shell_ + +```bash +redis-cli del "{forex_cache}_lock" +``` + +After making these changes, save the file and restart your application for the changes to take effect. + ## Enabling Data Features in Dashboard To check the data features in the dashboard, you need to enable them in the `config/dashboard.toml` configuration file.