Skip to main content

Analytics

Flipt includes functionality for reporting analytical data to a configurable storage engine. Currently, Flipt has support for collecting data into the following storage engines: The data that gets collected currently includes:
  • Flag Evaluation Count
Once a storage engine is configured, these analytics are viewable in the UI allowing users to visualize up to 24 hours of data for each metric. Analytics Dashboard The image above shows the past 30 minutes of the flag summer-sale evaluation counts.

Origin

Analytics are currently only collected as they pass through the evaluation server. This means that analytics will be captured if you are using the REST or GRPC APIs via one of our Server SDKs or GRPC SDKs for evaluations. We have plans to support collecting analytics for Client-Side evaluations in the future.

ClickHouse

You can use a self-hosted ClickHouse instance or a managed instance to store your analytics data. We highly recommend using a separate database for analytics produced by Flipt. This ensures that Flipt analytic data can be logically isolated from the rest of your Clickhouse data.
The analytics database must be created before Flipt will be able to write analytical data and run any migrations. See our migrate command for more info.
To create a database for Flipt analytics, you can use the following SQL:
CREATE DATABASE IF NOT EXISTS flipt_analytics_v2;
See the ClickHouse documentation for more information on how to get started with ClickHouse.

Configuration

To configure Flipt to use ClickHouse for analytics, you will need to add the following configuration to your config.yml file or environment variables:
FLIPT_ANALYTICS_STORAGE_CLICKHOUSE_ENABLED=true
FLIPT_ANALYTICS_STORAGE_CLICKHOUSE_URL=clickhouse://clickhouse:9000/flipt_analytics_v2

Prometheus

You can use any Prometheus server to store your analytics data.

Configuration

To configure Flipt to use Prometheus for analytics, you will need to add the following configuration to your config.yml file or environment variables:
FLIPT_ANALYTICS_STORAGE_PROMETHEUS_ENABLED=true
FLIPT_ANALYTICS_STORAGE_PROMETHEUS_URL=http://prometheus:9090

Custom Headers

You can also add custom headers to the Prometheus requests by setting the analytics.storage.prometheus.headers configuration property. This can be useful if you are using a proxy or need to add additional authentication headers.
analytics:
  storage:
    prometheus:
      headers:
        "Authorization": "Bearer <token>"

AWS SigV4 Authentication

If you are using Amazon Managed Service for Prometheus (AMP), you can configure Flipt to authenticate requests using AWS Signature Version 4 (SigV4).
analytics:
  storage:
    prometheus:
      enabled: true
      url: https://aps-workspaces.us-east-1.amazonaws.com/workspaces/<workspace-id>
      sigv4:
        enabled:  true
If access_key and secret_key are not provided, Flipt falls back to the default AWS credential chain (environment variables, shared credentials file, IAM instance profile, etc.). You can also assume an IAM role by specifying role_arn:
analytics:
  storage:
    prometheus:
      enabled: true
      url: https://aps-workspaces.us-east-1.amazonaws.com/workspaces/<workspace-id>
      sigv4:
        enabled: true
        region: us-east-1
        role_arn: arn:aws:iam::<account-id>:role/<role-name>
PropertyDescriptionDefault
analytics.storage.prometheus.sigv4.enabledEnable Prometheus SigV4 supportfalse
analytics.storage.prometheus.sigv4.regionAWS region for SigV4 signing
analytics.storage.prometheus.sigv4.access_keyAWS access key ID
analytics.storage.prometheus.sigv4.secret_keyAWS secret access key
analytics.storage.prometheus.sigv4.profileAWS credentials profile name
analytics.storage.prometheus.sigv4.role_arnARN of an IAM role to assume for authentication