---
description: How to export evaluation data?
---
import { integrations } from "@site/data/integrations";
import { Card } from "@site/src/components/doc/cardv3";

# 🚚 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](../concepts/exporter), 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.

<div className={"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4"}>
  {integrations.exporters.filter(item => item.docLink !== undefined).map((item) => {
    return (
      <Card
        logo={item.logo}
        link={`export-evaluation-data/${item.docLink}`}
        name={item.name}
        cssLogo={item.faLogo}
        description={item.description}
      />
    );
  })}
</div>

## 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.

```go title="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](https://github.com/thomaspoignant/go-feature-flag/pulls) 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.
:::