Introducing a new way to review your PRs.

Read the announcement

thomaspoignant / go-feature-flag

GO Feature Flag is a simple, complete and lightweight self-hosted cloud native feature flag solution 100% Open Source — built on OpenFeature 🎛️

View on GitHub

18 documents · Updated Nov 23, 2026

docs / relay-proxy

Relay proxy service

The relay proxy is a network service that makes GO Feature Flag evaluations available through standard HTTP interfaces. It keeps a local view of remote flag data, evaluates requests against that view, and sends flag use and change data to the configured systems. This lets applications in many languages use one remote flag service instead of loading the flag source directly.

Service composition

Flag source and evaluation layer

The flag source and evaluation layer turns one or more configured retrievers into a running flag client. The service can run one default flag set or several named flag sets. In the latter mode, an evaluation API key selects the flag set that serves the request. Each flag set can have its own flag source, change notifications, and event export settings.

The running clients refresh their flag cache at the configured interval. They also emit change events when the cache changes. A persistent flag file can provide a last-known configuration when the remote source is not available, while startWithRetrieverError controls whether the service may start without a successful first load.

References: cmd/…/flagset_manager.go• L30-47 cmd/…/gofeatureflag_client.go• L40-100 cmd/…/flagset.go• L9-92

Service adapters

The relay proxy groups its main duties behind a small set of services. The flag set manager selects the evaluation client, the monitoring service reports service state, the metrics service records operational data, and the stream services deliver flag changes to connected clients. The API server coordinates these services and applies the same request middleware across the public routes.

The process starts by loading and checking configuration. It then creates the metrics, stream, flag set, and monitoring services before it starts the API server. The metrics registry also receives a collector that reports the flags currently held by each cache. Startup logs report whether the binary uses FIPS 140-3 validated cryptography. During shutdown, stream clients disconnect first, the API server stops accepting requests, and the flag set manager closes last so buffered exporters can flush after request handling ends.

This diagram shows how configuration becomes a set of cached evaluators and how those evaluators serve requests and publish operational data.

flowchart LR
    Config[Configuration] --> Manager[Flag set manager]
    Manager --> Clients[Cached flag clients]
    Clients --> API[API server]
    Clients --> Events[Change events]
    Events --> Streams[WebSocket and SSE streams]
    Clients --> Exporters[Configured event exporters]
    Clients --> Loaded[Loaded-flag metric]
    API --> Metrics[Prometheus metrics]

References: cmd/…/main.go• L64-155 cmd/…/services.go• L8-19 cmd/…/server_lifecycle.go• L19-40 cmd/…/collector_flag_loaded.go• L15-99 cmd/…/main_test.go• L24-35

Server modes

The API server supports HTTP, Unix socket, and AWS Lambda modes. HTTP is the normal mode for a network service. Unix socket mode serves the same API through a local socket and can use a separate HTTP monitoring listener. Lambda mode adapts the Echo API to API Gateway or an Application Load Balancer.

HTTP and Unix socket modes start the monitoring listener when a monitoring port is configured. HTTP shutdown drains active requests, while Unix socket startup removes a stale socket file before it binds to the socket path. Lambda mode passes requests to the selected AWS adapter and can remove a configured API Gateway base path before route handling.

References: cmd/…/config_server.go• L7-56 cmd/…/server.go• L139-260 cmd/…/server_lifecycle.go• L33-140 cmd/…/lambda_handler.go• L1-120 cmd/…/lambda_handler_test.go• L21-230

Configuration model

Configuration inputs

The service reads configuration from command-line flags, a YAML, TOML, or JSON file, and environment variables. An explicit --config path takes priority. Without it, the process looks for goff-proxy configuration in the current directory, /goff/, and /etc/opt/goff/. Environment variables map to the same configuration keys and can supply array values such as API keys and retrievers. Nested flag-set retrievers, notifiers, and exporters can also be supplied through indexed environment variables.

The configuration controls six related concerns:

  • The server listener and runtime mode.
  • The flag sources and refresh behavior.
  • Access keys and optional flag set routing.
  • Notifications, event exporters, logs, metrics, and tracing.
  • Optional remote loading of named flag sets from GO Feature Flag Studio.
  • Endpoint-specific limits and protocol options.

References: cmd/…/config_loader.go• L75-90 cmd/…/config_loader.go• L262-294 cmd/…/config.go• L13-112 cmd/…/config_envvar.go• L13-49

Endpoint limits

Endpoint configuration sets safety limits for the administrative flag-file validation API. Each supported format has its own maximum body size. Unset limits use defaults of 1 MiB for JSON and 64 KiB for YAML or TOML. Configuration accepts byte counts or human-readable sizes such as 1MiB, and negative values are rejected before startup.

References: cmd/…/config_endpoints.go• L12-19 cmd/…/config_endpoints.go• L56-109 cmd/…/config_endpoints_test.go• L135-199

Studio flag source

GO Feature Flag Studio can provide the named flag sets from a remote document. The rest of the relay proxy configuration still comes from the normal configuration inputs. The service selects YAML, TOML, or JSON from the URL path and can send request headers such as authorization headers.

Studio polling can use a local cache file when the remote document is not reachable. The proxy validates a new document before it accepts it, so an invalid update does not replace the last valid flag-set configuration. A rejected update is retried rather than being treated as a valid cached version. Studio and local flagSets are alternative sources and cannot be used together.

References: cmd/…/config_studio.go• L13-71 cmd/…/config_loader.go• L296-328 cmd/…/config_studio_test.go• L83-221 cmd/…/config_studio_test.go• L301-414

Flag set routing

A flag set is a group of flags with a shared evaluation setup. In default mode, every authorized evaluation request uses one client. In local flag set mode, each flag set has a name and one or more API keys. In Studio mode, those named flag sets come from the remote Studio document. The manager maps the request key to the matching client before evaluation. API keys must not be shared by multiple flag sets because that would make the route unclear.

The configuration watcher can apply selected changes without a restart. Default mode accepts changes to evaluation and authorized keys. Named flag set mode can add or remove named flag sets and can change their API keys. Studio polling can replace the accepted named flag-set document. Changes to an existing flag set's retriever or event setup require a restart. The service does not switch between default mode, local flag set mode, and Studio mode during a reload. If a reload would leave a key mapped to more than one running flag set, the service disables that ambiguous route until the configuration is fixed.

References: cmd/…/flagset_manager.go• L205-270 cmd/…/flagset_manager.go• L302-372 cmd/…/flagset_manager.go• L532-613 cmd/…/config_loader.go• L109-216 cmd/…/config_validator.go• L29-35 cmd/…/config_change_test.go• L127-458

Container and Kubernetes packaging

The container distribution expects a proxy configuration file at /goff/goff-proxy.yaml and uses port 1031 by default. The same service can run from the Docker Hub image or from the GitHub Container Registry mirror for supported releases. The Helm chart packages the configuration as a mounted cluster resource and can expose a separate monitoring port for health and monitoring traffic. When configured, that monitoring port is exposed beside the application port and is used for liveness and readiness probes.

The chart also controls rollout behavior around pod termination. An optional native preStop sleep keeps a pod available while Kubernetes removes it from service endpoints, and terminationGracePeriodSeconds sets the time available for that hook and graceful shutdown. The chart can run the container as the distroless nonroot user with a hardened security context, but a read-only root filesystem is not enabled by that option because some flag and exporter settings write to the container filesystem. The Relay proxy deployment page describes these deployment contracts in detail.

For local source builds, cmd/relayproxy/Dockerfile.local compiles the relay proxy into a small runtime image. It keeps the same configuration mount and default port contract as the released image, so local runs can exercise the service through the standard container interface.

The chart also provides the deployment controls needed to run the service in Kubernetes. These include replica count, resource requests, service type, ingress, autoscaling, pod placement, security settings, and image selection. The current chart and application release are 1.59.1; the image settings also support a FIPS image variant. The Relay proxy deployment page describes these deployment contracts in detail.

References: cmd/…/Dockerfile.local• L1-32 cmd/…/DOCKERHUB.md• L18-59 cmd/…/DOCKERHUB.md• L41-44 cmd/…/values.yaml• L1-18 cmd/…/values.yaml• L86-130 cmd/…/values.yaml• L97-108 cmd/…/deployment.yaml• L34-94 cmd/…/lifecycle_test.yaml• L1-45 cmd/…/README.md• L1-5 cmd/…/README.md• L22-52 cmd/…/Chart.yaml• L1-9

API surface

Evaluation interfaces

The relay proxy exposes both its GO Feature Flag evaluation API and the OpenFeature Remote Evaluation Protocol (OFREP). Both interfaces accept an evaluation context and use the request API key to select the flag set. A single-flag request returns the selected value and evaluation details. A bulk request returns the values for all available flags or for a requested subset. An OFREP bulk response can also advertise the SSE change stream so a provider can refresh evaluations after a flag change.

Bulk evaluation handles flags independently. A missing targeting key can produce an evaluation error for a flag that needs bucketing while static flags can still return values. The OFREP handlers also keep malformed or unexpected request bodies within a JSON, non-server-error response boundary rather than allowing a request to panic. A flag key in a URL is decoded before lookup, so names with reserved characters can be evaluated.

The Relay evaluation APIs page describes the request and response contracts in detail.

References: cmd/…/routes_goff.go• L10-45 cmd/…/routes_ofrep.go• L9-26 cmd/…/flag_eval.go• L29-107 cmd/…/evaluate.go• L42-145 cmd/…/evaluate.go• L147-239 cmd/…/echo_helper.go• L45-57 cmd/…/evaluate_test.go• L274-444 cmd/…/evaluate_fuzz_test.go• L24-65

Flag configuration interface

The GO Feature Flag configuration endpoint lets a provider fetch the current flag definitions for local evaluation. A client can request all flags or name a subset. The response also includes evaluation-context enrichment and the cache refresh time, while malformed input and cache read failures return explicit errors.

This endpoint uses the same API-key routing as evaluation. In named flag set mode, the key selects the configuration that the client may use, so a provider does not receive definitions from another flag set.

References: cmd/…/flag_configuration.go• L30-115 cmd/…/flag_configuration_test.go• L25-250

Evaluation data and change interfaces

Evaluation clients can send cached usage events to /v1/data/collector. The proxy assigns those events to the selected flag client so the configured exporter can process them. Clients can also poll /v1/flag/change for a configuration hash or keep a live connection through WebSocket or Server-Sent Events (SSE), which is a one-way HTTP event stream.

The current stream paths are /stream/v1/ws/flag/change and /stream/v1/sse/flag/change. The older /ws/v1/flag/change path remains a deprecated alias and returns deprecation and successor-link headers. Stream clients provide their API key as the apiKey query parameter. In named flag set mode, the key selects one stream and the client receives only events for that flag set. The SSE stream sends an OFREP refetchEvaluation event rather than the flag diff, with a connection comment when it opens and periodic heartbeat comments by default. The client must fetch evaluations again after the event.

References: cmd/…/routes_goff.go• L35-39 cmd/…/routes_stream.go• L9-44 cmd/…/collect_eval_data.go• L42-135 cmd/…/sse_flag_change.go• L32-70 cmd/…/ws_flag_change.go• L73-156 cmd/…/options.go• L9-40 cmd/…/sse.go• L17-131 cmd/…/swagger.yaml• L634-671 website/…/relay_proxy_endpoints.md• L34-59

Operations and metadata interfaces

The service exposes health, cache information, metrics, and an optional profiling interface. /health reports that the service is initialized. /info reports the latest cache refresh time and, in flag set mode, the refresh time for each flag set. /metrics exposes Prometheus data when metrics are initialized.

When a monitoring port is configured, these monitoring routes run on a separate HTTP listener. Otherwise, they use the main API listener. The monitoring listener has the same cross-origin and version-header behavior as the main listener. The profiling interface is available when debug mode or EnablePprof is enabled.

The admin endpoints use the separate admin key set. /admin/v1/retriever/refresh forces the selected flag client to fetch current data. /admin/v1/flags/validate checks a submitted JSON, YAML, or TOML flag file without changing the flags that the proxy serves. The validation response reports a version, a validity result, and per-flag errors. The OpenFeature manifest endpoint returns the active flags and their default values. Swagger is available only when enabled in configuration. These interfaces help operators and SDKs inspect or manage the service without changing served flag data.

References: cmd/…/routes_monitoring.go• L14-53 cmd/…/server.go• L84-140 cmd/…/server_lifecycle.go• L84-127 cmd/…/routes_admin.go• L8-16 cmd/…/validate_flags.go• L38-69 cmd/…/validate_flags.go• L70-130 cmd/…/route_manifest.go• L8-12 cmd/…/monitoring.go• L10-66 cmd/…/routes_monitoring_test.go• L22-132 cmd/…/handlers_test.go• L34-230

Cross-origin access

The API and monitoring listeners accept cross-origin requests through the default CORS policy. A browser preflight is handled before authentication so browser clients can call protected evaluation routes. Requests without an Origin header do not receive an access-control origin header.

References: cmd/…/server.go• L61-94 cmd/…/routes_monitoring.go• L14-32 cmd/…/routes_cors_test.go• L85-169

Request handling

Request lifecycle

Each request enters through the API server and passes common logging, tracing, recovery, cross-origin, version, and optional Prometheus middleware. Route groups then apply the access rule for their audience. An evaluation handler validates the request, resolves the flag client from the API key, evaluates against its cache, and returns the protocol response.

The main request path is:

sequenceDiagram
    participant Client
    participant API as Relay API
    participant Auth as Access check
    participant Manager as Flag set manager
    participant Cache as Flag client cache
    participant Metrics as Metrics and traces

    Client->>API: Evaluation or data request
    API->>Auth: Check request key
    Auth-->>API: Allow or reject
    API->>Manager: Resolve flag set
    Manager-->>API: Selected cached client
    API->>Cache: Evaluate or collect events
    Cache-->>API: Result
    API->>Metrics: Record request activity
    API-->>Client: Protocol response

When debug logging is enabled, request bodies may be logged for diagnosis. Swagger requests and flag-file validation requests are excluded from body logging, and other logged bodies are limited to 8 KiB. This keeps large payloads from filling logs while preserving a sensitive-data risk for debug output.

References: cmd/…/server.go• L68-100 cmd/…/body_dump_handler.go• L12-53 cmd/…/flag_eval.go• L53-107 cmd/…/evaluate.go• L60-145

Access control and cache behavior

Evaluation and user-facing routes accept the Authorization header or the X-API-Key header. The X-API-Key value takes precedence when both headers exist. A Bearer prefix is removed from the Authorization value. When evaluation keys are configured, the proxy requires a valid key. Admin routes use the separate admin key set. Streaming routes use the API key query parameter because the connection must keep the key available while it stays open. The SSE and WebSocket handlers map that key to a flag set before they start the stream. In default mode, the stream uses the default flag set without requiring a key.

The proxy evaluates from its in-process cache rather than reading the remote flag source for each request. This reduces load on the source and gives callers a stable low-latency path. The trade-off is that a source or refresh problem can leave the service serving the last successful configuration or default values, depending on its startup and persistence settings.

References: cmd/…/server.go• L129-175 cmd/…/key_auth_extended.go• L51-116 cmd/…/stream_authorizer.go• L8-19 cmd/…/echo_helper.go• L13-42 cmd/…/sse_flag_change.go• L50-70 cmd/…/ws_flag_change.go• L108-127 cmd/…/gofeatureflag_client.go• L79-100

Metrics and telemetry

Prometheus metrics

The proxy keeps a private Prometheus registry and serves it from /metrics. The metrics describe evaluation volume, bulk evaluation volume, collected events, flag changes, forced refreshes, flag-file validation outcomes, configuration calls, manifest calls, process health, build information, and the flags currently loaded in each cache. Evaluation and flag-change metrics can include a flag_name label. Per-flag labels for bulk evaluation are opt-in because they can create many time series.

The gofeatureflag_flag_loaded gauge exposes one series with value 1 for each loaded flag and flag set. Its disabled label reflects the flag's effective state after scheduled steps and experimentation windows. The collector computes this view when Prometheus scrapes the registry, so removed flags disappear after the cache refreshes. If a flag set or its cache is unavailable, the collector emits no series for that source rather than inventing a loaded state.

The metric names use the gofeatureflag subsystem prefix. The Prometheus notifier connects flag cache changes to the flag create, update, delete, and total change counters. HTTP middleware adds request timing data to the same registry. Histogram output supports both classic buckets and Prometheus native histogram data.

Metric groupWhat it helps answer
Evaluation countersHow often clients request one or many flag values
Collection countersHow much usage data reaches the proxy
Change countersWhich flag changes the cache observes
Loaded-flag gaugeWhich flags each flag set currently holds and whether they are effectively disabled
Validation counterHow often flag-file validation succeeds, finds invalid flags, or fails before validation
Control countersHow often refresh, configuration, and manifest operations run
Runtime collectorsWhether the process and build are healthy

References: cmd/…/metrics.go• L9-22 cmd/…/metrics.go• L32-172 cmd/…/notifier_prometheus.go• L17-33 cmd/…/collector_flag_loaded.go• L25-99 cmd/…/server.go• L77-89 cmd/…/validate_flags.go• L70-73 cmd/…/collector_flag_loaded_test.go• L58-247 cmd/…/server_test.go• L1048-1156

Tracing and logs

The service can initialize OpenTelemetry tracing and adds spans around evaluation, event collection, manifest generation, forced refresh, and flag-file validation. Logs expose startup, configuration, refresh, and shutdown events. Debug logging can also include request bodies, so operators should treat debug output as more sensitive than normal logs.

References: cmd/…/server_lifecycle.go• L19-28 cmd/…/server.go• L61-76 cmd/…/collect_eval_data.go• L58-63 cmd/…/validate_flags.go• L99-122

Remote feature flag role

Central flag service

The relay proxy sits between application clients and the system that stores flag configuration. It reads the remote source on a schedule, keeps the current data close to request handlers, and exposes language-neutral evaluation protocols. This central path lets several services use the same flag rules without each service needing direct access to the source.

The design also supports clients that need either pull or push behavior. Pull clients use evaluation, flag-configuration, or change-hash endpoints. Push-capable clients use WebSocket or SSE streams to learn about flag changes. Usage events can travel back through the collector endpoint to the configured data exporters. The feature flag SDK page explains the client-side role in this remote evaluation path.

References: cmd/…/README.md• L17-27 cmd/…/README.md• L42-59 cmd/…/flag_configuration.go• L48-62 cmd/…/routes_stream.go• L9-29

Web provider validation

The web provider playground is a local test setup for the remote flag path in a browser. It connects the OpenFeature web provider to a relay proxy over SSE or WebSocket, evaluates live flags, and shows provider events and status as the proxy refreshes its flag source.

The setup also models a stream outage without stopping evaluation requests. Its stream blocker closes or rejects only /stream/* and /ws/* traffic, so the browser provider can demonstrate its fallback to polling through the ordinary evaluation endpoints. This makes the relationship between push-based change notices and pull-based evaluation visible without treating the playground as production service code.

References: cmd/…/README.md• L1-32 cmd/…/README.md• L172-218 cmd/…/docker-compose.yml• L1-8 cmd/…/goff-proxy.yaml• L1-11 cmd/…/main.ts• L119-177 cmd/…/main.ts• L185-240 cmd/…/stream-blocker.mjs• L1-64

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the route groups, authentication rules, and the documented evaluation contracts aligned when an endpoint path or request key changes.
  • Keep the admin key rule aligned between refresh, flag-file validation, and future administrative routes.
  • Keep flag-file content types, per-format body limits, parser behavior, HTTP status codes, and validation outcome metrics aligned.
  • Keep debug body logging exclusions aligned with any endpoint that accepts sensitive or large flag documents.
  • Keep flag set names, API-key routing, and reload rules aligned when the flag set configuration model changes.
  • Keep Studio URL parsing, request headers, validation, cache fallback, and polling reload behavior aligned when the Studio source changes.
  • Keep the metrics registry, metric labels, and dashboards aligned when an endpoint starts or stops recording a metric.
  • Keep the loaded-flag gauge labels and its effective disabled-state rule aligned with cache contents and flag evaluation semantics.
  • Keep monitoring port resolution aligned between server configuration and the Helm service, probes, and exposed ports.
  • Keep the stream API-key rule aligned between WebSocket, SSE, and any client that maintains a long-lived connection.
  • Keep the SSE event contract aligned with OFREP clients when stream payloads, event names, connection comments, or heartbeat timing change.
  • Keep the flag-set route selection aligned with stream isolation so a client cannot receive changes from another flag set.
  • Keep the persistent cache and startWithRetrieverError behavior aligned with the availability promise made to callers.
  • Keep bulk and single-flag behavior aligned with the evaluation context rules when targeting-key handling changes.
  • Keep URL path decoding aligned with flag names that contain reserved characters.
  • Keep CORS and version-header behavior aligned between the main API listener and the monitoring listener.
  • Keep the selected container image tag and chart appVersion aligned when releasing a new proxy version.
  • Keep chart lifecycle hooks and termination grace settings compatible with the Kubernetes version and the distroless runtime image.
  • Keep the chart security defaults compatible with any exporter or persistent flag configuration that writes to the container filesystem.
  • Keep the web provider playground's local ports, proxy configuration paths, and stream-blocker route rules aligned with the relay proxy's public interfaces.
  • Keep shutdown ordering aligned so streams close before the API stops and buffered exporters close after request handling ends.

Important failure modes

TriggerConsequenceGuard
No usable retriever is configuredConfiguration validation fails and the proxy does not startValidate each default or flag set configuration before startup
A remote retriever cannot load flags at startup while startWithRetrieverError is falseThe flag client cannot start with a usable configurationEnable the setting only when default or persisted values are acceptable
One API key belongs to more than one flag setConfiguration is rejected or routing is disabled until the collision is fixedAssign each evaluation key to one flag set
Studio and local flagSets are configured togetherConfiguration is rejected and the two sources cannot be mergedSelect one named flag-set source
The Studio document is unreachable and no valid cache existsNo Studio flag sets are available for the serviceConfigure a reachable URL or a cache file with a last valid document
A Studio update is invalidThe last accepted flag-set document remains active and the new version is retriedValidate the complete document before accepting its version
A request omits or uses an invalid evaluation key while authentication is enabledThe proxy returns an authorization error and does not evaluate the requestSend the key in Authorization or X-API-Key; use apiKey for streams
An administrative request uses an evaluation key instead of an admin keyRefresh or flag-file validation is rejectedProvide a key from the configured admin key set
A flag-file validation request has no supported Content-TypeThe proxy returns 415 without validating the bodySend JSON, YAML, or TOML with its supported media type
A flag-file validation body exceeds its format limitThe proxy returns 413 and does not validate the complete documentSet a suitable per-format limit and keep request bodies within it
A flag-file document cannot be parsedThe proxy returns 400 and the served flag cache is unchangedParse the document before relying on its validation result
A flag-file document contains invalid flagsThe proxy returns 422 with per-flag errors; served flags remain unchangedTreat valid: false as a failed pre-deployment check
An evaluation context has no targeting key for a flag that needs bucketingA single-flag request fails; a bulk response can contain a per-flag error for that flagSupply a targeting key when rules use percentage or other bucketing logic
A flag name contains a reserved URL character and the path is not decodedThe proxy looks up the wrong flag and returns a not-found or wrong resultEncode the path value and preserve URL decoding before lookup
A reload changes unsupported fields of an existing flag setThe change is ignored until the next process restartRestart after changing retrievers, exporters, notifiers, or polling behavior
The flag source stops refreshing after the last successful loadCallers can receive stale cached valuesMonitor refresh times from /info and force a refresh when appropriate
A monitoring port is configured but the deployment exposes only the main API portHealth and metric checks cannot reach the monitoring listenerExpose and probe the effective monitoring port in the deployment
A browser sends an authenticated request without a completed preflightThe browser blocks the request before the evaluation route can runAllow the CORS preflight on the API and monitoring listeners
A named flag set stream has no API key or the key is unknownThe stream request is rejected before the connection startsPass one valid key that maps to the intended flag set
A client treats an SSE change event as a flag diffThe client keeps stale evaluations because the event only tells it to refetchHandle refetchEvaluation by requesting current evaluations again
An intermediary closes an idle SSE connectionThe client loses change notifications until it reconnectsKeep heartbeats enabled or configure the client and proxy for the chosen heartbeat interval
The loaded-flag collector cannot read a flag set or its cache during a scrapePrometheus sees no loaded-flag series for that source and may show incomplete inventoryTreat the gauge as a cache view and pair it with cache health and refresh signals
A chart lifecycle hook uses a shell command with the distroless imageThe pre-stop action fails and the pod may stop before traffic drainsUse the native Kubernetes sleep action for supported Kubernetes versions
A deployment enables a read-only root filesystem while using a file exporter or persistent flag fileFlag data or exported events cannot be writtenProvide a writable filesystem or use storage settings that match the selected security context
Shutdown closes flag sets before requests and streams finishIn-flight work or buffered usage events can be lostDisconnect streams, stop the API, then close flag sets so exporters flush last

Key files

FileWhy to read it
cmd/…/main.goShows how configuration, metrics, streams, flag clients, monitoring, and the API server are composed and shut down.
cmd/…/main_test.goShows the required shutdown order that lets the API stop before flag-set exporters flush.
cmd/…/server.go, cmd/…/server_lifecycle.go, cmd/…/routes_monitoring.goShows the common request middleware, server modes, listener lifecycle, route assembly, monitoring listener choice, and graceful shutdown.
cmd/…/body_dump_handler.goShows the debug request-body logging boundary and its exclusions for large or sensitive admin payloads.
cmd/…/routes_goff.go, routes_ofrep.go, routes_stream.go, routes_admin.goShows the public evaluation, OFREP, live change, and administrative interfaces.
cmd/…/flag_eval.go, flag_configuration.go, validate_flags.go, cmd/…/evaluate.goShows the single-flag, flag-configuration, flag-file validation, and OFREP request contracts.
cmd/…/sse_flag_change.go, cmd/…/ws_flag_change.go, cmd/…/sse.go, options.goShows how streams select a flag set and how change, connection, heartbeat, and keep-alive behavior reach clients.
cmd/…/echo_helper.goShows API-key precedence and URL decoding for flag names.
cmd/…/swagger.yaml, swagger.json, docs.goShows the published API contract for evaluation, monitoring, validation, and stream endpoints.
cmd/…/config_loader.go, config.go, config_envvar.go, config_endpoints.go, config_server.goShows how configuration enters the service, how nested environment values are mapped, and how endpoint limits and listener modes are selected.
cmd/…/config_studio.go, config_studio_test.goShows how Studio supplies named flag sets, validates updates, uses cache fallback, and reloads accepted documents.
cmd/…/flagset.go, config_validator.go, exporter.goShows the flag set model and the rules that must hold before the proxy starts, including exporter requirements.
cmd/…/flagset_manager.goShows how API keys resolve to cached flag clients and how safe runtime reloads work.
cmd/…/gofeatureflag_client.goShows how one configured flag set becomes a running evaluator with retrievers, notifiers, and exporters.
cmd/…/metrics.go, notifier_prometheus.go, collector_flag_loaded.goShows the operational signals exposed by the proxy, including validation outcomes and the loaded-flag gauge.
cmd/…/collector_flag_loaded_test.go, metrics_test.goShows the loaded-flag and endpoint-counter metric contracts.
cmd/relayproxy/Dockerfile.localShows how to build and run a local source-based container with the same configuration path and port contract as the service image.
cmd/…/DOCKERHUB.mdShows the container contract for configuration mounting, the default port, and supported image registries.
cmd/…/values.yaml, templates/deployment.yaml, tests/lifecycle_test.yaml, README.md, Chart.yamlShows the Kubernetes configuration contract, monitoring-port behavior, probe port selection, lifecycle and termination controls, security option, FIPS image option, and current chart release version.
cmd/…/config_flags_special_chars.yaml, responses/valid_evaluation_special_chars.jsonShows that URL-escaped flag names with reserved characters resolve to the intended flag.
cmd/…/README.md, docker-compose.yml, relay-proxy/goff-proxy.yaml, stream-blocker.mjsShows a local browser-provider setup that exercises live flag changes, SSE and WebSocket delivery, and polling fallback during stream failure.