Skip to main content
Version: v1.40.0

🚚 Export evaluation data

Overview​

Sometimes when you are using feature flags in your application, you may want to collect data on how the flags are being used. This is the reason why GO Feature Flag has the exporter concept, a mechanism that store an event for each evaluation of a flag.

About exporters​

To export evaluation data, you have to configure the target where you want to export the data.

GO Feature Flag provides a list of built-in exporters that you can use out of the box. The goal is to let you choose the one that fits your needs the best.

During flag evaluation, the key, flag variation and other non-sensitive information used are collected and cached for a configurable period of time. When the cache is full or the cache duration is reached, the exporter is called with the list of events to store it where you want.

You have 2 different ways to specify a exporter depending on if you are using the GO Module or the Relay Proxy. In all the details pages of the exporters bellow you will have an example for both examples.

Available Exporters​

Bellow is the full list of exporters that are available in GO Feature Flag.

logo
AWS S3

Export evaluation data to a AWS S3 Bucket.

More details
logo
Azure Blob Storage

Export evaluation data to an Azure Blob Storage.

More details
logo
Google Cloud Storage

Export evaluation data to a Google Cloud Storage Bucket.

More details
logo
File System

Export evaluation data to a directory in your file system.

More details
logo
Apache Kafka

Export evaluation data inside a Kafka topic.

More details
logo
AWS Kinesis

Export evaluation data inside a Kafka Kinesis stream.

More details
logo
Google Cloud PubSub

Export evaluation data inside a GCP PubSub topic.

More details
logo
AWS SQS

Export evaluation data inside a AWS SQS queue.

More details
logo
Webhook

Export evaluation data by calling a HTTP Webhook.

More details
Log

Export evaluation data inside the application logger.

More details

Custom exporter​

If you have a specific use case that is not covered by the built-in exporters, you can create your own custom exporter.

To create a custom exporter you must have a struct that implements the exporter.Exporter interface.

exporter.go
type Exporter interface {
// Export will send the data to the exporter.
Export(context.Context, *fflog.FFLogger, []exporter.FeatureEvent) error

// IsBulk return false if we should directly send the data as soon as it is produced
// and true if we collect the data to send them in bulk.
IsBulk() bool
}
  • Export(...) is called asynchronously with a list of exporter.FeatureEvent that have been collected. It is your responsibility to store them where you want.
  • IsBulk() function should return false if the exporter can handle the results in stream mode. If you decide to manage it in streaming mode, everytime we call a variation the Export function will be called with only on event in the list.
note

If you think your custom exporter could be useful for others, feel free to open a pull request to add it to the list of available exporters.

warning

If you are using a custom exporter, it is easy to use it for the GO Module, but if you want to use it in the relay proxy you will have to recompile it yourself.