openfeature

package
v2.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package openfeature provides a lightweight bridge between the tracer's early Remote Config subscription and the late-created OpenFeature DatadogProvider.

This package intentionally has minimal dependencies (only internal/remoteconfig) so the tracer can import it without pulling in the OpenFeature SDK or OTel.

Index

Constants

View Source
const (
	// FFEProductName is the RC product name for feature flag evaluation.
	FFEProductName = "FFE_FLAGS"
)

Variables

This section is empty.

Functions

func AttachCallback

func AttachCallback(cb Callback) bool

AttachCallback wires the given callback to the global RC subscription. If SubscribeRC() was called (i.e. the tracer subscribed), it replays any buffered config and returns true. Otherwise returns false, meaning the caller should fall back to its own RC subscription.

func GetBufferedForTest

func GetBufferedForTest() remoteconfig.ProductUpdate

GetBufferedForTest returns the current buffered update for testing.

func ResetForTest

func ResetForTest()

ResetForTest resets the global rcState for test isolation.

func SetBufferedForTest

func SetBufferedForTest(u remoteconfig.ProductUpdate)

SetBufferedForTest sets a buffered update for testing.

func SetSubscribedForTest

func SetSubscribedForTest(v bool)

SetSubscribedForTest sets the subscribed flag without actually calling Subscribe.

func SubscribeProvider

func SubscribeProvider(cb remoteconfig.ProductCallback) (tracerOwnsSubscription bool, err error)

SubscribeProvider attempts to subscribe a provider callback to RC. It holds the subscription mutex to prevent races with SubscribeRC.

func SubscribeRC

func SubscribeRC() error

SubscribeRC subscribes to the FFE_FLAGS RC product using a forwarding callback. It is called by the tracer during startRemoteConfig() so that FFE_FLAGS is included in the first RC poll.

Types

type Callback

type Callback func(update remoteconfig.ProductUpdate) map[string]rc.ApplyStatus

Callback is a function that processes an RC product update and returns apply statuses. This matches the signature of DatadogProvider.rcCallback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL