Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .riot/requirements/104618a.txt

This file was deleted.

21 changes: 0 additions & 21 deletions .riot/requirements/1346280.txt

This file was deleted.

26 changes: 0 additions & 26 deletions .riot/requirements/183bf88.txt

This file was deleted.

21 changes: 0 additions & 21 deletions .riot/requirements/1d5d90b.txt

This file was deleted.

25 changes: 0 additions & 25 deletions .riot/requirements/1fd3342.txt

This file was deleted.

21 changes: 0 additions & 21 deletions .riot/requirements/68eb9ac.txt

This file was deleted.

24 changes: 0 additions & 24 deletions .riot/requirements/db50e43.txt

This file was deleted.

2 changes: 1 addition & 1 deletion ddtrace/internal/native/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ._native import SerializationError # noqa: F401
from ._native import TraceExporter # noqa: F401
from ._native import TraceExporterBuilder # noqa: F401
from ._native import ffande_process_config # noqa: F401
from ._native import ffe # noqa: F401
from ._native import logger # noqa: F401
from ._native import store_metadata # noqa: F401

Expand Down
62 changes: 55 additions & 7 deletions ddtrace/internal/native/_native.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Dict, List, Literal, Optional
from typing import Dict, List, Literal, Optional, Any
from enum import Enum

class DDSketch:
def __init__(self): ...
Expand Down Expand Up @@ -447,11 +448,58 @@ class SerializationError(Exception):

...

def ffande_process_config(config_bytes: bytes) -> Optional[bool]:
class ffe:
"""
Process feature flagging and experimentation configuration rules.

:param config_bytes: Raw bytes containing the configuration data
:return: True if processing was successful, False otherwise, None on error
Native Feature Flags and Experimentation module.
"""
...

class FlagType(Enum):
String = ...
Integer = ...
Float = ...
Boolean = ...
Object = ...

class Reason(Enum):
Static = ...
Default = ...
TargetingMatch = ...
Split = ...
Cached = ...
Disabled = ...
Unknown = ...
Stale = ...
Error = ...

class ErrorCode(Enum):
TypeMismatch = ...
ParseError = ...
FlagNotFound = ...
TargetingKeyMissing = ...
InvalidContext = ...
ProviderNotReady = ...
General = ...

class ResolutionDetails:
@property
def value(self) -> Optional[Any]: ...
@property
def error_code(self) -> Optional[ffe.ErrorCode]: ...
@property
def error_message(self) -> Optional[str]: ...
@property
def reason(self) -> Optional[ffe.Reason]: ...
@property
def variant(self) -> Optional[str]: ...
@property
def allocation_key(self) -> Optional[str]: ...
@property
def flag_metadata(self) -> dict[str, str]: ...
@property
def do_log(self) -> bool: ...
@property
def extra_logging(self) -> Optional[dict[str, str]]: ...

class Configuration:
def __init__(self, config_bytes: bytes) -> None: ...
def resolve_value(self, flag_key: str, expected_type: ffe.FlagType, context: dict) -> ffe.ResolutionDetails: ...
14 changes: 8 additions & 6 deletions ddtrace/internal/openfeature/_config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from typing import Mapping
from typing import Optional

from ddtrace.internal.native._native import ffe

FFE_CONFIG: Mapping = {}

FFE_CONFIG: Optional[ffe.Configuration] = None


def _get_ffe_config():
"""Retrieve the current IAST context identifier from the ContextVar."""
"""Retrieve the current FFE configuration."""
return FFE_CONFIG


def _set_ffe_config(data):
def _set_ffe_config(config):
"""Set the FFE configuration."""
global FFE_CONFIG
"""Retrieve the current IAST context identifier from the ContextVar."""
FFE_CONFIG = data
FFE_CONFIG = config
128 changes: 0 additions & 128 deletions ddtrace/internal/openfeature/_ffe_mock.py

This file was deleted.

Loading
Loading