Skip to main content
Version: v1.40.0

File System

Overview​

Export evaluation data to a directory in your file system.

Everytime the FlushInterval or MaxEventInMemory is reached a new file will be added to File System.

info

If for some reason the File System upload fails, we will keep the data in memory and retry to add the next time we reach FlushInterval or MaxEventInMemory.

Configure the relay proxy​

To configure your relay proxy to use the File System exporter, you need to add the following configuration to your relay proxy configuration file:

goff-proxy.yaml
# ...
exporter:
kind: file
outputDir: /output-data/
# ...
Field nameMandatoryTypeDefaultDescription
kindstringnoneValue should be file.
This field is mandatory and describes which retriever you are using.
outputDirstringnoneOutputDir is the location of the directory where to store the exported files.
pathstringbucket root levelThe location of the directory in Google Cloud Storage.
flushIntervalint60000The interval in millisecond between 2 calls to the webhook (if the maxEventInMemory is reached before the flushInterval we will call the exporter before).
maxEventInMemoryint100000If we hit that limit we will call the exporter.
formatstringJSONFormat is the output format you want in your exported file. Available format: JSON, CSV, Parquet.
filenamestringflag-variation-{{ .Hostname}}-{{ .Timestamp}}.{{ .Format}}You can use a config template to define the name of your exported files. Available replacements are {{ .Hostname}}, {{ .Timestamp}} and {{ .Format}
csvTemplatestring{{ .Kind}};{{ .ContextKind}};{{ .UserKey}};{{ .CreationDate}};{{ .Key}};{{ .Variation}};{{ .Value}};{{ .Default}};{{ .Source}}\nCsvTemplate is used if your output format is CSV.
This field will be ignored if you are using format other than CSV.
You can decide which fields you want in your CSV line with a go-template syntax, please check exporter/feature_event.go to see what are the fields available.
parquetCompressionCodecstringSNAPPYParquetCompressionCodec is the parquet compression codec for better space efficiency. Available options

Configure the GO Module​

To configure your GO module to use the File System exporter, you need to add the following configuration to your ffclient.Config{} object:

example.go
config := ffclient.Config{
// ...
DataExporter: ffclient.DataExporter{
// ...
Exporter: &fileexporter.Exporter{
OutputDir: "/output-data/",
Format: "csv",
FileName: "flag-variation-{{ .Hostname}}-{{ .Timestamp}}.{{ .Format}}",
CsvTemplate: "{{ .Kind}};{{ .ContextKind}};{{ .UserKey}};{{ .CreationDate}};{{ .Key}};{{ .Variation}};{{ .Value}};{{ .Default}};{{ .Source}}\n"
},
},
// ...
}
err := ffclient.Init(config)
defer ffclient.Close()
Field nameMandatoryDefaultDescription
OutputDir noneOutputDir is the location of the directory to store the exported files.
FlushInterval60000The interval in millisecond between 2 calls to the webhook (if the maxEventInMemory is reached before the flushInterval we will call the exporter before).
MaxEventInMemory100000If we hit that limit we will call the exporter.
FormatJSONFormat is the output format you want in your exported file. Available format: JSON, CSV, Parquet.
Filenameflag-variation-{{ .Hostname}}-{{ .Timestamp}}.{{ .Format}}You can use a config template to define the name of your exported files. Available replacements are {{ .Hostname}}, {{ .Timestamp}} and {{ .Format}
CsvTemplate{{ .Kind}};{{ .ContextKind}};{{ .UserKey}};{{ .CreationDate}};{{ .Key}};{{ .Variation}};{{ .Value}};{{ .Default}};{{ .Source}}\nCsvTemplate is used if your output format is CSV.
This field will be ignored if you are using format other than CSV.
You can decide which fields you want in your CSV line with a go-template syntax, please check exporter/feature_event.go to see what are the fields available.
Pathbucket root levelThe location of the directory in S3.
ParquetCompressionCodecSNAPPYParquetCompressionCodec is the parquet compression codec for better space efficiency. Available options