Requirement
Organizations running data warehouses on AWS Redshift need a first-class exporter that loads
flag evaluation events directly into Redshift — without requiring an S3 intermediate stage.
This enables BI teams to join feature flag data with application metrics already in Redshift
using standard SQL.
Proposed implementation
Create a new redshiftexporter package using the AWS SDK v2 Redshift Data API
(redshiftdata.ExecuteStatement) to perform batched INSERT statements. The Redshift Data API
is serverless and requires no persistent JDBC connection, making it well-suited for async bulk export.
Exporter: &redshiftexporter.Exporter{
ClusterIdentifier: "my-cluster",
Database: "analytics",
DbUser: "goff_writer",
TableName: "feature_flag_evaluations", // default for FeatureEvent
TrackingTableName: "tracking_events", // default for TrackingEvent
AwsConfig: &awsConfig,
AutoMigrate: true,
}
The exporter must handle both event types that GO Feature Flag emits:
FeatureEvent — flag evaluation results
TrackingEvent — custom tracking/experimentation events
Proposed table schemas
feature_flag_evaluations (FeatureEvent)
| Column |
Redshift type |
Source field |
kind |
VARCHAR(50) |
Kind |
context_kind |
VARCHAR(50) |
ContextKind |
user_key |
VARCHAR(512) |
UserKey |
creation_date |
BIGINT |
CreationDate (unix) |
key |
VARCHAR(256) |
Key (flag name) |
variation |
VARCHAR(256) |
Variation |
value |
SUPER |
Value (any type) |
default |
BOOLEAN |
Default |
version |
VARCHAR(64) |
Version |
source |
VARCHAR(64) |
Source |
metadata |
SUPER |
Metadata (map) |
tracking_events (TrackingEvent)
| Column |
Redshift type |
Source field |
kind |
VARCHAR(50) |
Kind |
context_kind |
VARCHAR(50) |
ContextKind |
user_key |
VARCHAR(512) |
UserKey |
creation_date |
BIGINT |
CreationDate (unix) |
key |
VARCHAR(256) |
Key (flag name) |
variation |
VARCHAR(256) |
Variation |
value |
SUPER |
Value |
default |
BOOLEAN |
Default |
version |
VARCHAR(64) |
Version |
tracking_details |
SUPER |
TrackingDetails (map) |
evaluation_context |
SUPER |
EvaluationContext (map) |
Relay proxy YAML configuration
exporter:
kind: redshift
clusterIdentifier: my-cluster
database: analytics
dbUser: goff_writer
tableName: feature_flag_evaluations
trackingTableName: tracking_events
awsRegion: us-east-1
autoMigrate: true
exporterEventType: feature # "feature" | "tracking" | omit for both
Acceptance criteria
Requirement
Organizations running data warehouses on AWS Redshift need a first-class exporter that loads
flag evaluation events directly into Redshift — without requiring an S3 intermediate stage.
This enables BI teams to join feature flag data with application metrics already in Redshift
using standard SQL.
Proposed implementation
Create a new
redshiftexporterpackage using the AWS SDK v2 Redshift Data API(
redshiftdata.ExecuteStatement) to perform batched INSERT statements. The Redshift Data APIis serverless and requires no persistent JDBC connection, making it well-suited for async bulk export.
The exporter must handle both event types that GO Feature Flag emits:
FeatureEvent— flag evaluation resultsTrackingEvent— custom tracking/experimentation eventsProposed table schemas
feature_flag_evaluations(FeatureEvent)kindcontext_kinduser_keycreation_datekeyvariationvaluedefaultversionsourcemetadatatracking_events(TrackingEvent)kindcontext_kinduser_keycreation_datekeyvariationvaluedefaultversiontracking_detailsevaluation_contextRelay proxy YAML configuration
Acceptance criteria
Export(ctx, logger, []ExportableEvent) errorandIsBulk() bool(returnstrue) inexporter/redshiftexporter/FeatureEventandTrackingEvent(route to separate tables based on type assertion)github.com/aws/aws-sdk-go-v2/service/redshiftdata) — not a direct JDBC/psql connectionAutoMigrateflag toCREATE TABLE IF NOT EXISTSon first run using the schemas aboveDbUseroptional when using IAM role viaClusterIdentifier+WorkgroupName)redshiftinExporterKindenum (cmd/relayproxy/config/exporter.go)cmd/relayproxy/config/exporter.go)case "redshift"increateExporter()(cmd/relayproxy/service/gofeatureflag_client.go)website/docs/