-
Notifications
You must be signed in to change notification settings - Fork 22
Labels
good first issueGood for newcomersGood for newcomers
Description
Requirements
#327 introduced a method for tracking user interactions
dotnet-sdk/src/OpenFeature/OpenFeatureClient.cs
Lines 305 to 328 in 929fa74
| /// <summary> | |
| /// Use this method to track user interactions and the application state. | |
| /// </summary> | |
| /// <param name="trackingEventName">The name associated with this tracking event</param> | |
| /// <param name="evaluationContext">The evaluation context used in the evaluation of the flag (optional)</param> | |
| /// <param name="trackingEventDetails">Data pertinent to the tracking event (Optional)</param> | |
| /// <exception cref="ArgumentException">When trackingEventName is null or empty</exception> | |
| public void Track(string trackingEventName, EvaluationContext? evaluationContext = default, TrackingEventDetails? trackingEventDetails = default) | |
| { | |
| if (string.IsNullOrWhiteSpace(trackingEventName)) | |
| { | |
| throw new ArgumentException("Tracking event cannot be null or empty.", nameof(trackingEventName)); | |
| } | |
| var globalContext = Api.Instance.GetContext(); | |
| var clientContext = this.GetContext(); | |
| var evaluationContextBuilder = EvaluationContext.Builder() | |
| .Merge(globalContext) | |
| .Merge(clientContext); | |
| if (evaluationContext != null) evaluationContextBuilder.Merge(evaluationContext); | |
| this._providerAccessor.Invoke().Track(trackingEventName, evaluationContextBuilder.Build(), trackingEventDetails); | |
| } |
This method is not currently available on the IFeatureClient abstraction. This means developers or consumers who depend on this abstraction cannot use this method. While Tracking is still experimental, it would be good to ensure we appropriately expose this API.
beeme1mr and ghelyar
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers