Skip to content

Support metadata on segments (similar to flag metadata) #5989

Description

@olenakuzmenko

Problem

Feature flags support additional metadata fields that are not returned to SDKs during evaluation. This is useful for storing internal context (notes, ownership info, etc.) without leaking it to clients.

Segments do not have an equivalent mechanism. Any information added to a segment (key, name, description) is fully visible in evaluation responses — including the snapshot endpoint used by client-side SDKs.

Use Case

We create one segment per customer, keyed by their UUID. We use the Flipt Client JS SDK which fetches the full ruleset from /v1/evaluation/snapshot/namespace/{namespace} and evaluates flags locally in the browser.

This means all segments participating in rules are visible in the network response. Using UUIDs as segment keys keeps things anonymous — no customer can identify another customer from the response payload.

However, UUIDs make the Flipt UI difficult to use for operators. We'd like to annotate segments with human-readable customer names for internal use, without that information being exposed to client-side SDKs.

Today, the only options are:

  • Use human-readable names → leaks customer identities to the browser
  • Use UUIDs everywhere → poor operator experience in the Flipt UI

Proposed Solution

Add a metadata map to segments (same mechanism as flag metadata) that:

  1. Is editable in the Flipt UI
  2. Is stored and queryable via the management API
  3. Is excluded from evaluation/snapshot responses returned to SDKs

This would allow us to store something like displayName (or any other internal context) on a segment
without exposing it to end users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementCreated by Linear-GitHub Sync

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions