Skip to content

Provide a method to return all flag keys #2937

@bfrearson

Description

@bfrearson

Feature description

I'd like to be able to log the current state of all flags for a given evaluation context for debugging. I realise that I could iterate over my known expected flag keys locally, but this is not very scalable, and because my project is modular, there's not a single place that I store all my keys.

I know that the api response includes all of these details, so we just need a method to expose them in the SDK.

Proposed solution

Add a new property FlagsClient.keys that returns all the key Strings for the current evaluation context.

Clients can then iterate over the keys to fetch all values for logging, debugging etc.

Other relevant information

Providing just the keys rather than the values prevents users from misusing the SDK and creating a cache of all values that might go stale.

The datadog dashboard doesn't currently show evaluations from users, which is why we need this method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions