Skip to content

[FEATURE] Record flag set ID for OTEL metrics #2020

Closed

Description

@juanparadox

Requirements

I would like to be able to see metrics based on the flag set ID when using OTEL for both flagd and OFREP.

The attribute for this could be feature_flag.metadata.flag_set_id or some other name that points to the flag set ID.

Activity

  1. gargsajal9 commented on Sep 13, 2026

    @gargsajal9
    Contributor

    Hi @toddbaert and @bacherfl — could you take a quick look at this proposed contract before I start implementing it?

    I traced the current evaluation telemetry paths. OpenTelemetry already defines the release-candidate feature_flag.set.id attribute, so I think we should use that instead of adding a flagd-specific name.

    My proposed behavior is:

    • add it to impression and reason/error metrics when a non-empty string ID is available;
    • use each evaluation result’s existing metadata for single and bulk evaluations;
    • for a failed lookup with an explicit flagSetId selector, use the selected ID;
    • omit the attribute when the ID is unknown; and
    • for unfiltered bulk requests spanning multiple sets, attribute each result separately instead of using a synthetic value.

    This wouldn’t export arbitrary metadata or change responses, selectors, traces, storage, metric names, or the existing cardinality limit.

    Does that behavior sound right, especially using the selector ID for failed lookups and including it on reason/error metrics?

  2. juanparadox commented on Sep 30, 2026

    @juanparadox
    MemberAuthor

    @gargsajal9 Did you by chance start on this? Didn't want to start work on this if you were already addressing it.

  3. gargsajal9 commented on Sep 30, 2026

    @gargsajal9
    Contributor

    Thanks for checking, @juanparadox. I haven’t started implementation — I’ve only done the setup, source tracing, focused baseline, and posted the contract proposal above, which is still waiting for maintainer confirmation. Please feel free to take it forward; I’m happy to coordinate or collaborate so we don’t duplicate work.

  4. beeme1mr commented on Oct 2, 2026

    @beeme1mr
    Member

    Hey @juanparadox and @gargsajal9! I think `feature_flag.set.id, as @gargsajal9 recommend, would be best.

    The only real challenge is deciding when to omit the attribute due to cardinality reasons. @gargsajal9 proposal seems to address that pretty thoroughly.

  5. gargsajal9 commented on Oct 2, 2026

    @gargsajal9
    Contributor

    If we are onboard on the approach, I am happy to start the implementation and share the PR for review.
    @beeme1mr @juanparadox if you are ok should I start working on PR then?

  6. erka commented on Oct 2, 2026

    @erka
    Member

    Just do it @gargsajal9. It’ll take less time to implement than to discuss it.

  7. gargsajal9 commented on Oct 2, 2026

    @gargsajal9
    Contributor

    Implementation is ready in #2078. It follows the feature_flag.set.id behavior discussed above

  8. added a commit that references this issue on Oct 20, 2026
    10f2ca0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs TriageThis issue needs to be investigated by a maintainerenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions