Volver al ranking

openflagr/flagr

Goopenflagr.github.io/flagr

Flagr is a feature flagging, A/B testing and dynamic configuration microservice

feature-flagsab-testinggolangdynamic-configurationswaggerfeature-toggles
Crecimiento de estrellas
Estrellas
2.6k
Forks
203
Crecimiento semanal
Issues
0
1k2k
nov 2017sept 2020ago 2023jul 2026
ArtefactosGo Modulesgo get github.com/openflagr/flagr
README

Flagr

Ask DeepWiki

What is Flagr?

Flagr is an open-source Go service for feature flags, A/B tests, and dynamic configuration. One primitive, the flag, backs all three: your code calls POST /api/v1/evaluation, Flagr looks at who is asking (entityID, entityContext), and returns a variant plus optional JSON attachment.

That lets you decouple deploy from release (ship code dark, turn it on per audience), run experiments with sticky assignment, and change runtime config without redeploying.

openflagr/flagr is the community home of Flagr, continuing development from the original checkr/flagr.


Documentation

Site: https://openflagr.github.io/flagr (VitePress)

Contributors: clone the repo and run make help (build, test, UI, CI targets). Docs: make serve-docs (http://127.0.0.1:8081/flagr/) / make build-docsdocs/.vitepress/dist.

Page Content
Behavioral contracts Eval vs exposure, recording, eval-only, cache
Integration guide Eval, batch, exposures (client API)
Contributing Clone, build, test, OpenAPI
Overview Concepts, running example, architecture
Use cases Flags, A/B, dynamic config; GET ?json= eval
Built-in context injection @ts*, @http_* in entityContext
Self-hosting Docker, DB, Compose, K8s
Environment variables DB, auth, recorders (pkg/config/env.go)
Exposure logging Client impressions for A/B
Data recorders Kafka, Kinesis, Pub/Sub
API reference OpenAPI

Features

  • Feature flags - kill switches, targeted rollouts
  • GET evaluation - GET /api/v1/evaluation?json=… (same JSON as POST; use cases)
  • Built-in context injection - @ts* and @http_* keys merged server-side (guide)
  • Duplicate flag - POST /flags/{id}/duplicate or UI Duplicate Flag
  • A/B testing - deterministic assignment; pair with exposure logging
  • Dynamic configuration - variantAttachment JSON on eval responses
  • GitOps - json_file / json_http; flagr-validate in CI
  • Exposure logging - POST /exposures for trustworthy denominators
  • Self-hosted - official Docker image + env vars
  • Databases - SQLite, MySQL, PostgreSQL, or JSON sources
  • Vue 3 UI - TypeScript (browser/flagr-ui); make build-ui, make test-e2e

Quick start

docker pull ghcr.io/openflagr/flagr
docker run -it -p 18000:18000 ghcr.io/openflagr/flagr

open http://localhost:18000

Demo API: try-flagr.onrender.com (may cold-start)

curl -sS -X POST https://try-flagr.onrender.com/api/v1/evaluation \
  -H 'content-type: application/json' \
  -d '{
    "entityID": "127",
    "entityType": "user",
    "entityContext": { "state": "NY" },
    "flagID": 1,
    "enableDebug": true
  }'

Flagr UI

Flagr UI

Architecture

Three parts (overview diagram, behavioral contracts):

  • Evaluator - POST or GET /evaluation reads EvalCache in memory (default reload 3s; no per-request SQL). Bucketing and stickiness: overview. GET: use cases.
  • Manager - CRUD + flag_snapshot rows; webhooks after commit.
  • Metrics - async recorders (Kafka, Kinesis, Pub/Sub, Datar); slow sinks do not block eval.

Source: pkg/handler/eval.go, eval_cache.go, crud.go.

Performance

vegeta load test (~2k req/s, sub-ms median in published run):

Requests      [total, rate]            56521, 2000.04
Duration      [total, attack, wait]    28.26s, 28.26s, 365.53µs
Latencies     [mean, 50, 95, 99, max]  371.63µs, 327.99µs, 614.92µs, 1.39ms, 12.50ms
Success       [ratio]                  100.00%
Status Codes  [code:count]             200:56521

Client libraries

Language Client
Go goflagr
JavaScript jsflagr
Python pyflagr
Ruby rbflagr

License

Repositorios relacionados
PostHog/posthog

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

PythonPyPIOtheranalyticspython
posthog.com
37.1k3.1k
Unleash/unleash

Open-source feature management platform

TypeScriptnpmGNU Affero General Public License v3.0featurefeature-toggle
getunleash.io
13.7k875
openreplay/openreplay

Session replay, cobrowsing and product analytics you can self-host. Best for reproducing issues and iterating on your product.

TypeScriptnpmOthersession-replayreact
openreplay.com
12.3k761
growthbook/growthbook

Open Source Feature Flags, Experimentation, and Product Analytics

TypeScriptnpmOtherabtestingstatistics
growthbook.io
8k796
vercel/next-forge

Production-grade Turborepo template for Next.js apps.

TypeScriptnpmMIT Licensenextjsprisma
next-forge.com
7.1k662
Flagsmith/flagsmith

Flagsmith is an open source feature flagging and remote config service. Self-host or use our hosted version at https://app.flagsmith.com.

PythonPyPIBSD 3-Clause "New" or "Revised" Licensefeature-flagscontinuous-integration
flagsmith.com
6.5k549
Countly/countly-server

Countly is a privacy-first, AI-powered analytics and engagement platform for understanding and optimizing customer journeys across digital applications, from desktop and mobile to IoT and connected environments.

JavaScriptnpmOtherweb-analyticsdashboard
countly.com
5.9k981
haydenbleasel/next-forge

Production-grade Turborepo template for Next.js apps.

TypeScriptnpmMIT Licensenextjsprisma
next-forge.com
5.5k443
flipt-io/flipt

Enterprise-ready, Git native feature management solution

GoGo ModulesOthergofeature-flags
flipt.io
4.9k298
flippercloud/flipper

🐬 Beautiful, performant feature flags for Ruby.

RubyRubyGemsMIT Licenseflipperruby
flippercloud.io/docs
4k437
fetlife/rollout

Feature flippers.

RubyRubyGemsMIT Licenserolloutfeature-flags
2.9k214
uber/piranha

A tool for refactoring code related to feature flag APIs

Rustcrates.ioApache License 2.0javafeature-flags
2.5k209