Skip to content

AWS Kinesis ​

Overview ​

Export evaluation data inside a Kafka Kinesis stream.

NOTE

AWS Kinesis is an exporter of type queue, it means that it send events as soon as he receives them it does not work in bulk but in near real time.

Configure the relay proxy ​

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

yaml
# ...
exporters:
  - kind: kinesis
    streamArn: "arn:aws:kinesis:us-east-1:XXXX:stream/test-stream"
# ...
Field nameMandatoryTypeDefaultDescription
kindYesstringnoneValue should be kinesis.
This field is mandatory and describes which retriever you are using.
streamArnYesstringnoneThe ARN of your kinesis stream.
streamNameNostringnoneThe name of your kinesis stream.

Configure the GO Module ​

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

go
awsConfig, _ := config.LoadDefaultConfig(context.Background())
config := ffclient.Config{
   // ...
   DataExporter: ffclient.DataExporter{
        // ...
        Exporter: &kinesisexporter.Exporter{
            Settings: kinesisexporter.NewSettings(
                kinesisexporter.WithStreamName("test-stream"),
                kinesisexporter.WithPartitionKey("0"),
                kinesisexporter.WithExplicitHashKey("0"),
            ),
            AwsConfig: &config, // aws custom configuration
        },

    },
    // ...
}
client, err := ffclient.New(config)
defer client.Close()
FieldMandatoryDescription
StreamName YesName of the Kinesis stream to publish messages to
PartitionKey NoFunction that takes 'FeatureEvent' as an input and returns calculated string 'Partition Key'. If not specified, then by default string 'default' will be used for all events. Effectively this will assign all events to a single Kinesis shard. There is nothing bad in using single shard, but for performance consideration this field might be utilised.
ExplicitPartitionKey NoString key to identify which stream shard event data belongs to. Overrides PartitionKey setting
AwsConfig NoAn instance of *aws.Config that holds additional settings connect to AWS

Released under the MIT License.