Skip to content

(feature) AWS Redshift (Redshift Data API) exporter #5086

Description

@thomaspoignant

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

  • Implement Export(ctx, logger, []ExportableEvent) error and IsBulk() bool (returns true) in exporter/redshiftexporter/
  • Handle both FeatureEvent and TrackingEvent (route to separate tables based on type assertion)
  • Use Redshift Data API (github.com/aws/aws-sdk-go-v2/service/redshiftdata) — not a direct JDBC/psql connection
  • Batch events into a single multi-row INSERT per flush cycle
  • Support optional AutoMigrate flag to CREATE TABLE IF NOT EXISTS on first run using the schemas above
  • Support IAM role authentication (DbUser optional when using IAM role via ClusterIdentifier + WorkgroupName)
  • Register redshift in ExporterKind enum (cmd/relayproxy/config/exporter.go)
  • Add relay proxy YAML config fields and validation (cmd/relayproxy/config/exporter.go)
  • Add case "redshift" in createExporter() (cmd/relayproxy/service/gofeatureflag_client.go)
  • Add unit tests with a mocked Redshift Data API client interface
  • Add documentation page under website/docs/

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions