Deploying Custom Telemetry Service
Rafiki allows for integrating Account Servicing Entities (ASE) to build their own telemetry solution based on the OpenTelemetry standardized metrics format that Rafiki exposes.
In order to do so, the integrating ASE must deploy its own OpenTelemetry collector that should act as a sidecar container to Rafiki. It needs to provide the OpenTelemetry collector’s ingest endpoint so that Rafiki can start sending metrics to it.
Rafiki Telemetry Environment Variables
ENABLE_TELEMETRY
: boolean, defaults totrue
. Enables the telemetry service on Rafiki.LIVENET
: boolean. Should be set totrue
on production environments dealing with real money. If it is not set, it will default tofalse
, and metrics will get sent to the testnet otel-collectorOPEN_TELEMETRY_COLLECTOR_URLS
: CSV of URLs for Open Telemetry collectors (e.g.,http://otel-collector-NLB-e3172ff9d2f4bc8a.elb.eu-west-2.amazonaws.com:4317,http://happy-life-otel-collector:4317
).OPEN_TELEMETRY_EXPORT_INTERVAL
: number in milliseconds, defaults to15000
. Defines how often the instrumented Rafiki instance should send metrics.TELEMETRY_EXCHANGE_RATES_URL
: string URL, defaults tohttps://telemetry-exchange-rates.s3.amazonaws.com/exchange-rates-usd.json
. It defines the endpoint that Rafiki will query for exchange rates, as a fallback when ASE does not provide them. If set, the response format of the external exchange rates API should be of type Rates, as the rates service expects. The default endpoint set here points to a public S3 that has the previously mentioned required format, updated daily.
Example Docker OpenTelemetry Collector Image and Configuration
Example of Docker OpenTelemetry Collector image and configuration that integrates with Rafiki and sends data to a Prometheus remote write endpoint:
(it can be tested in our Local Playground setup, by also providing the environment variables listed above to happy-life-backend in the docker-compose)