Skip to content

Enable applications to report what features are being used, what were the states during a request, etc... #3

Open

Description

Currently feature management can be used to gate application functionality behind features. An important part of this flow is measuring how often these features are being used, and whether these features are healthy. The feature management interfaces lack the ability to extrapolate data such as what features were accessed during their request and what are their states. This should be added.

Activity

  1. kevinv53 commented on May 7, 2023

    @kevinv53

    Is there any update on this?

    There is Azure Monitoring and Cost Analysis but I'm not sure that those cover what is requested on this ticket.

  2. jimmyca15 commented on May 8, 2023

    @jimmyca15
    MemberAuthor

    Hello kevinv53 this is the issue that we are currently designing a solution for. The current line of thought is to have an interface that is internally invoked whenever a flag is evaluated.

    Exact interface and naming TBD, but something along the lines of the following:

    ITelemetryPublisher
    {
        ValueTask Publish(EvaluationResult result, CancellationToken cancellationToken);
    }
    
    public class EvaluationResult
    {
        string FeatureName { get; set; }
    
        bool Enabled { get; set; }
    }
    

    It allows one to implement ITelemetryPublisher and emit/persist feature flag evaluations wherever desired.

  3. jimmyca15 commented on Oct 13, 2023

    @jimmyca15
    MemberAuthor

    Added in preview branch

    #259

    #281

  4. amis92 commented on Oct 25, 2023

    @amis92

    I am excited for the work done in this area, however seeing the ITelemetryPublisher I couldn't help but wonder, why was DiagnosticSource not used? It seems like a perfect fit for this purpose. I'd even consider ActivitySource usage since some feature evaluations can be complex and even hit external dependencies, and having distributed tracing support for such cases could be very helpful. And these are native, runtime built-in solutions for exactly that purpose. ApplicationInsights integration with DiagnosticSource would be a breeze (it's how appins creates RequestTelemetry), and it'd also make it easy to integrate with any and all other OTel-based components nearly out of the box.

    I think this was essentially what was asked for in #219

    Would you still consider working in that direction, or is ITelemetryPublisher definitely your last word in this area?

  5. jimmyca15 commented on Oct 25, 2023

    @jimmyca15
    MemberAuthor

    Amadeusz Sadowski (@amis92)

    Can't an implementation of ITelemetryPublisher be made to satsify what you have suggested?

  6. amis92 commented on Oct 25, 2023

    @amis92

    It can, but that doesn't make a lot of sense to me - as I see it, the TelemetryPublisher is a custom solution duplicating existing framework component. I don't see what's the benefit doing it this way instead of framework-standard. As a bonus, there'd be less public API surface, less maintenance, and more possible optimizations from using framework code.

  7. jimmyca15 commented on Oct 27, 2023

    @jimmyca15
    MemberAuthor

    Amadeusz Sadowski (@amis92)

    From my understanding DiagnosticSource doesn't play as well as we'd like with DI to put us where we want to be for this enhancement. I'm not aware of any patterns to have diagnostic source listeners be DI aware. This makes it a bit difficult to work with in our case given the libraries focus on DI usage.

    See current proposed usage in Application Insights publisher example:

    builder.Services.AddFeatureManagement()
        .AddTelemetryPublisher<ApplicationInsightsTelemetryPublisher>();
    

    I appreciate any thoughts you have on the topic.

  8. amis92 commented on Nov 30, 2023

    @amis92

    It seems there's now IMeterFactory which satisfies the Dependency Injection scenario :) https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.imeterfactory?view=net-8.0

    It'd be helpful if the framework-based solutions could work more-or-less out of the box, instead of depending on an Azure-focused extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions