Event exporter integrations
Event exporter integrations send feature evaluation and tracking events to analytics, observability, storage, queue, logging, and webhook systems. Each destination follows one shared exporter contract, so the exporter manager can fan out the same event stream to several destinations while each integration controls its own output form and delivery method.
Integration model
The exporter manager is the common delivery layer for all destinations. It owns one event store and gives each configured destination its own consumer position. This lets one destination flush or fail without changing the delivery state of another destination. See the event export pipeline page for the event lifecycle before integration delivery.
When the feature flag client starts, it separates feature events from tracking events and creates a manager for each event type that has configured destinations. A destination can receive one event at a time or a group of events. The manager uses that choice to decide whether to send at once or to wait for a flush interval or memory limit.
The following diagram shows how a configured destination plugs into the manager.
flowchart LR
E[Feature or tracking event] --> M[Exporter manager]
M --> S[Shared event store]
S --> C1[Destination consumer]
S --> C2[Destination consumer]
C1 --> D1[Exporter integration]
C2 --> D2[Exporter integration]
D1 --> O1[External destination]
D2 --> O2[External destination]
Exporter contract
An exporter integration implements the common exporter contract. It declares whether it supports bulk delivery and accepts a context, the shared logger, and exportable events. Exportable events provide stable keys, a creation time, and JSON or CSV formatting for destinations that need a serialized event.
The manager assigns each integration a separate consumer identity. A successful export advances only that integration's position, while an error leaves its events available for a later flush. The manager stops all consumers and the shared store during client shutdown.
References: exporter/exporter.go• L24-32 exporter/exportable_event.go• L7-18 exporter/manager.go• L12-80 exporter/event_store.go• L50-75
Event type routing
The configuration uses eventType to route a destination to either feature events or tracking events. The default is feature events. The client creates separate managers for the two event types, so a destination configured for tracking data does not receive feature evaluation data.
References: config_exporter.go• L9-14 config_exporter.go• L16-35 feature_flag.go• L125-156 exporter/feature_event.go• L44-87 exporter/tracking_event.go• L12-38
Delivery timing
Bulk integrations wait for the configured flush interval or for their in-memory event limit. Immediate integrations are flushed when the manager receives an event. The manager also flushes every integration during shutdown so buffered data can reach its destination before the client closes.
References: exporter/data_exporter.go• L14-17 exporter/data_exporter.go• L74-106 exporter/manager.go• L46-80 config_exporter.go• L16-27
Destination families
The relay proxy maps each configured kind to one destination implementation. The same exporter manager settings apply across the families, while the destination-specific settings identify the remote resource or output format.
| Family | Supported kinds | Delivery purpose |
|---|---|---|
| Analytics | bigquery, redshift | Store typed feature or tracking rows for analysis. |
| Observability | opentelemetry | Create feature evaluation spans. |
| Storage | file, s3, googleStorage, azureBlobStorage | Write event batches as JSON, CSV, or Parquet files. |
| Queues and streams | sqs, kinesis, kafka, pubsub | Publish serialized events to message or stream systems. |
| Logging | log | Write formatted event lines through the application logger. |
| Webhooks | webhook | POST event batches to an HTTP endpoint. |
References: cmd/…/exporter.go• L119-153 cmd/…/gofeatureflag_client.go• L215-325
Analytics destinations
The BigQuery integration turns feature and tracking events into rows in a Google BigQuery table. Feature rows retain evaluation fields such as the flag key, variation, value, default use, source, and metadata. Tracking rows retain the tracking details and evaluation context. The integration can create the dataset and table when auto-migration is enabled.
BigQuery is a bulk destination. It groups rows into bounded insert requests and uses a stable event-based insert identity to reduce duplicate rows when a request is retried. It does not accept a mixed batch of feature and tracking event types.
References: exporter/…/exporter.go• L70-123 exporter/…/exporter.go• L153-175 exporter/…/exporter.go• L207-230 exporter/…/exporter.go• L299-324
The Redshift integration stores feature and tracking events in AWS Redshift tables. It uses separate schemas for the two event types and selects a default table for each type unless the destination supplies a table name. Auto-migration can create the matching table when the destination starts writing.
Redshift is a bulk destination. It sends bounded SQL batches through the Redshift Data API and waits for each transaction to finish. It supports both provisioned clusters and serverless workgroups, while AWS credentials and optional database access settings identify the write path.
The integration skips events that cannot be converted to JSON or that are too large for Redshift and reports them through the exporter logger. It rejects a batch that mixes feature and tracking events, because each event type has a different table shape.
References: exporter/…/exporter.go• L122-175 exporter/…/exporter.go• L216-264 exporter/…/exporter.go• L267-329 exporter/…/exporter.go• L492-535
Observability destinations
The OpenTelemetry integration represents each feature evaluation as a span named feature_flag.evaluate. It records the evaluation context and result as span attributes, including flag identity, user identity, variation, value, source, and metadata. A fallback evaluation is marked as an error status so downstream tracing tools can distinguish it from a successful evaluation.
This integration is immediate and only handles feature events. Its tracer name can be set to match the surrounding OpenTelemetry service.
References: exporter/…/exporter.go• L21-32 exporter/…/exporter.go• L44-67 exporter/…/exporter.go• L69-137
Storage destinations
File storage integrations turn event batches into files. The local file destination appends JSON or CSV records and writes Parquet for supported event types. S3, Google Cloud Storage, and Azure Blob Storage use the same file formats, then place the generated file in a bucket or container under an optional path.
These destinations are bulk integrations because their useful unit of work is a file batch. File names can include the host, time, and format. CSV output can use a template, while Parquet output can use a selected compression codec.
| Kind | Remote resource | Required identity |
|---|---|---|
file | Local output directory | outputDir in relay proxy configuration. |
s3 | Amazon S3 bucket and path | bucket. |
googleStorage | Google Cloud Storage bucket and path | bucket. |
azureBlobStorage | Azure Blob Storage container and path | accountName and container. |
References: exporter/…/exporter.go• L22-50 exporter/…/exporter.go• L57-113 exporter/…/exporter.go• L21-54 exporter/…/exporter.go• L20-52 exporter/…/exporter.go• L19-37
Queue and stream destinations
Queue and stream integrations publish JSON event messages to a remote messaging resource. They use immediate delivery at the manager level, but a single export call can still contain several events when the destination client supports that form. Each system adds its own routing identity or message metadata so consumers can process the event as a native message.
| Kind | Destination | Event delivery shape |
|---|---|---|
sqs | AWS SQS queue | One JSON message per event. |
kinesis | AWS Kinesis stream | JSON records with a partition key. |
kafka | Kafka topic | JSON messages keyed by the event user key. |
pubsub | Google Cloud Pub/Sub topic | One JSON message per event with an emitter attribute. |
Kinesis requires a stream name or ARN. Kafka requires a topic and broker addresses. Pub/Sub requires a project and topic. SQS requires a queue URL. The relay proxy selects the current Pub/Sub v2 integration for the pubsub kind; the older package remains a deprecated library path.
References: exporter/…/exporter.go• L19-37 exporter/…/exporter.go• L48-79 exporter/…/exporter.go• L153-224 exporter/…/exporter.go• L24-40 exporter/…/exporter.go• L48-85 exporter/…/exporter.go• L15-31 exporter/…/exporter.go• L40-77
Logging destinations
The log integration formats each event as a log line and sends it through the shared feature flag logger. Its format can include event fields and a formatted RFC 3339 date. The default format gives operators a compact view of the user, flag, and returned value.
Logging is immediate rather than buffered as a batch. This makes it useful for local diagnostics and for log systems already attached to the application process.
References: exporter/…/exporter.go• L14-27 exporter/…/exporter.go• L33-58
Webhook destinations
The webhook integration sends a JSON POST request to an HTTP endpoint. The request groups events under an events field and adds a meta object. The integration adds the local host name when the caller does not provide one. Optional headers support endpoint-specific needs.
When a secret is configured, the integration signs the request body and sends the signature in X-Hub-Signature-256. A response with an HTTP status of 400 or higher is treated as an export error. Webhooks are bulk integrations because the request carries an event collection.
References: exporter/…/exporter.go• L21-62 exporter/…/exporter.go• L64-123 exporter/…/exporter.go• L126-130
Destination configuration
The relay proxy accepts one exporter configuration for each destination. It first validates the kind and the destination identity, then maps the configuration to the matching exporter and applies shared defaults for format, file name, CSV template, compression, flush interval, and event memory limit.
The following settings identify the main configuration boundary.
| Setting | Role |
|---|---|
kind | Selects the destination family. |
eventType | Selects feature or tracking events. |
flushInterval | Sets the wait time for bulk delivery. |
maxEventInMemory | Sets the batch size limit for bulk delivery. |
| Destination fields | Identify a path, bucket, topic, queue, table, or endpoint. |
Destination validation prevents incomplete configurations from reaching the manager. For example, storage destinations need a bucket or output directory, queue destinations need their queue or stream identity, a webhook needs an endpoint URL, and Redshift needs a database plus exactly one cluster or serverless workgroup.
References: cmd/…/exporter.go• L10-43 cmd/…/exporter.go• L45-165 cmd/…/gofeatureflag_client.go• L163-213 cmd/…/gofeatureflag_client.go• L301-327
Integration selection guide
Choose a destination based on the system that will consume the events. The event manager behavior is shared, so the main choice is the downstream data shape and delivery contract.
| Need | Recommended family | Main consideration |
|---|---|---|
| Query evaluation or tracking history | BigQuery | The table schema differs by event type. |
| Query evaluation or tracking history in AWS | Redshift | Choose a cluster or serverless workgroup and a database. |
| Trace evaluation behavior | OpenTelemetry | Feature evaluations become spans. |
| Archive files or load another data tool | File or object storage | Select JSON, CSV, or Parquet. |
| Decouple event processing | SQS, Kinesis, Kafka, or Pub/Sub | Configure the native queue or stream identity. |
| Inspect events in process logs | Log | Use the log format that the log system can parse. |
| Notify an external service | Webhook | Provide an endpoint and validate the optional signature. |
One event type can have several destinations. For example, a feature event can go to a warehouse for analysis and to OpenTelemetry for traces. Each destination consumes the event independently through the manager.
References: feature_flag.go• L125-156 exporter/manager.go• L24-64 cmd/…/gofeatureflag_client.go• L194-342
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the exporter kind list, configuration validation, and relay proxy factory aligned when adding or removing a destination.
- Keep the
eventTyperouting contract aligned with both manager types and with destinations that support only feature events. - Preserve the
IsBulkchoice when changing a destination. It controls whether the manager sends an event at once or waits for a batch. - Keep serialized event fields aligned across webhook payloads, message bodies, file formats, and warehouse row schemas.
- Keep destination identity checks aligned with the fields passed from
ExporterConfto the integration. - Keep Redshift validation aligned with its cluster/workgroup choice, database access settings, table-name rules, and AWS client mapping.
- Keep shutdown behavior aligned with buffered destinations so the manager flushes before the event store stops.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A destination kind is valid in configuration but missing from the relay proxy factory | The exporter cannot be created even though validation accepts the kind. | Update the kind list, validation, and factory as one contract. |
| A bulk destination cannot reach its service during a flush | Its consumer position does not advance, so the pending events remain for a later attempt. | Monitor exporter errors and keep the destination available during the flush window. |
| A queue or stream identity is missing | The destination cannot publish messages. | Validate the required queue URL, stream, topic, project, or broker settings before startup. |
| A BigQuery batch contains both feature and tracking events | The export fails because one table schema cannot represent both row shapes. | Route each event type to its matching manager and destination configuration. |
| A Redshift destination receives mixed event types | The export fails because feature and tracking rows use different table schemas. | Route one event type to each destination manager. |
| A Redshift row cannot fit the Data API or table limits | The row is skipped and the exporter logs a warning instead of retrying it forever. | Keep event text and JSON values within the destination limits and monitor skip warnings. |
| A Redshift statement does not finish before its timeout | The transaction is cancelled and the export fails, so the manager can retry the pending events. | Set a timeout that fits the database load and inspect Redshift statement errors. |
| A webhook returns HTTP 400 or higher | The batch is reported as an export error and is not acknowledged by that consumer. | Check endpoint status handling and use the optional body signature for request validation. |
| An event cannot be encoded in the destination format | The current export call fails before the consumer advances. | Keep event fields serializable and validate custom CSV or file format changes. |
Key files
| File | Why to read it |
|---|---|
| exporter/manager.go | Shows how one manager fans events out to independent destination consumers. |
| exporter/data_exporter.go | Shows the shared bulk and immediate delivery contract. |
| exporter/event_store.go | Shows how consumer positions keep destinations independent. |
| cmd/…/exporter.go | Defines supported kinds and destination-level validation. |
| cmd/…/gofeatureflag_client.go | Maps configuration to concrete integrations and shared defaults. |
| feature_flag.go | Shows the split between feature-event and tracking-event managers. |
| exporter/feature_event.go | Defines the feature event fields that analytics and storage destinations share. |
| exporter/…/exporter.go | Describes the BigQuery row model and table delivery. |
| exporter/…/exporter.go | Describes AWS Redshift table delivery, event-type schemas, and transaction handling. |
| exporter/…/exporter_test.go | Shows the supported Redshift connection modes, table behavior, size limits, and failure handling. |
| exporter/…/exporter.go | Describes the common file formats used by local and object storage destinations. |
| exporter/…/exporter.go | Describes the HTTP payload and request signing contract. |
| exporter/…/exporter.go | Describes the evaluation span produced for observability. |
| exporter/…/exporter.go | Describes per-event SQS message delivery. |
| exporter/…/exporter.go | Describes stream records and partition routing. |
| exporter/…/exporter.go | Describes topic messages and user-key message keys. |
| exporter/…/exporter.go | Describes the Pub/Sub destination selected by the relay proxy. |
| exporter/…/exporter.go | Describes formatted event output through the application logger. |