diff --git a/.vale/styles/Flipt/spelling-exceptions.txt b/.vale/styles/Flipt/spelling-exceptions.txt index 55a2923..6a1f767 100644 --- a/.vale/styles/Flipt/spelling-exceptions.txt +++ b/.vale/styles/Flipt/spelling-exceptions.txt @@ -4,6 +4,7 @@ auditable backoff boolean caddy +clickhouse codeowners codespaces config @@ -52,7 +53,6 @@ protoc Quicksort redis regexes -rflipt rollout rollouts SCMs diff --git a/cli/commands/migrate.mdx b/cli/commands/migrate.mdx index 355a639..9a9bbdb 100644 --- a/cli/commands/migrate.mdx +++ b/cli/commands/migrate.mdx @@ -10,8 +10,9 @@ flipt migrate [flags] ### Options ``` - --config string path to config file - -h, --help help for migrate + --config string path to config file + --database string string to denote which database type to migrate (default "default") + -h, --help help for migrate ``` ### More Info diff --git a/configuration/analytics.mdx b/configuration/analytics.mdx new file mode 100644 index 0000000..02f9dfc --- /dev/null +++ b/configuration/analytics.mdx @@ -0,0 +1,41 @@ +--- +title: Analytics +description: This document describes various configuration mechanisms for controlling analytics for Flipt. +--- + +## Analytics + +Since [v1.37.0](https://github.com/flipt-io/flipt/releases/tag/v1.37.0) Flipt includes functionality for reporting analytical data to a configurable storage engine. + +Currently, Flipt has support for collecting data into: + +- [Clickhouse](https://clickhouse.com/) + +The data that gets collected currently includes: + +- Flag Evaluation Count + +Once a storage backend is configured, these analytics are viewable in the UI allowing users to visualize up to 24 hours of data for each metric. + +![UI For Analytics](/images/configuration/analytics_quick_view.png) + +The image above shows the past 30 minutes of the flag `flag1` evaluation counts. + +## Considerations + +### Database + +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 + [migration](https://www.flipt.io/docs/configuration/storage#migrations) + section for more info. + + +### Origin of Analytics + +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](/integration/server/rest) or [GRPC SDKs](/integration/server/grpc) for evaluations. + +We have plans to support collecting analytics for [Client-Side](/integration/client) evaluations in the future. diff --git a/configuration/overview.mdx b/configuration/overview.mdx index a9ce68a..b84fd4b 100644 --- a/configuration/overview.mdx +++ b/configuration/overview.mdx @@ -236,7 +236,7 @@ export FLIPT_CORS_ALLOWED_ORIGINS="http://localhost:3000 http://localhost:3001" | storage.git.authentication.basic.username | The username to use for basic authentication | | v1.25.0 | | storage.git.authentication.basic.password | The password to use for basic authentication | | v1.25.0 | | storage.git.authentication.token | The access token to use for authentication | | v1.25.0 | -| storage.git.authentication.ssh.password | Password used to generate the SSH keypair | | v1.30.0 | +| storage.git.authentication.ssh.password | Password used to generate the SSH key pair | | v1.30.0 | | storage.git.authentication.ssh.private_key_path | Path to private key on the filesystem | | v1.30.0 | | storage.git.authentication.ssh.private_key_bytes | (Alternative) Raw private key bytes | | v1.30.0 | | storage.git.authentication.ssh.insecure_ignore_host_key | Skip verifying the known hosts key (avoid in production) | false | v1.30.0 | @@ -320,6 +320,19 @@ export FLIPT_CORS_ALLOWED_ORIGINS="http://localhost:3000 http://localhost:3001" | audit.sinks.webhook.max_backoff_duration | Max exponential backoff duration for sending webhook upon failure | 15s | v1.27.0 | | audit.sinks.webhook.templates[] | List of webhook templates for Flipt to send audit events to | | v1.28.0 | +### Analytics + +| Property | Description | Default | Since | +| ----------------------------- | ----------------------------------------------- | ------- | ------- | +| analytics.buffer.flush_period | Duration to wait before sending events to sinks | 10s | v1.37.0 | + +#### Analytics: Clickhouse + +| Property | Description | Default | Since | +| ------------------------------------ | ----------------------------------- | ------- | ------- | +| analytics.storage.clickhouse.enabled | Enable Clickhouse support | false | v1.37.0 | +| analytics.storage.clickhouse.url | URL to connect to clickhouse server | | v1.37.0 | + ### Tracing | Property | Description | Default | Since | diff --git a/configuration/storage.mdx b/configuration/storage.mdx index 733dcf4..1786df1 100644 --- a/configuration/storage.mdx +++ b/configuration/storage.mdx @@ -82,6 +82,8 @@ From time to time the Flipt database must be updated with new schema. To accomplish this, Flipt includes a `migrate` command that will run any pending database migrations for you. +By default Flipt will run your application data migrations. You can run migrations on your [analytical](/configuration/analytics) databases by specifying the `--database=analytics` flag to the migrate command. + If Flipt is started and there are pending migrations, you will see the following error in the console: diff --git a/images/configuration/analytics_quick_view.png b/images/configuration/analytics_quick_view.png new file mode 100644 index 0000000..c4e14b3 Binary files /dev/null and b/images/configuration/analytics_quick_view.png differ diff --git a/mint.json b/mint.json index 3601029..f957a15 100644 --- a/mint.json +++ b/mint.json @@ -132,13 +132,13 @@ "configuration/observability", "configuration/storage", "configuration/telemetry", + "configuration/analytics", { "group": "Auditing", "pages": [ "configuration/auditing/overview", "configuration/auditing/webhooks" ] - } ] },