Skip to content
Prev Previous commit
Next Next commit
Resolving comments
  • Loading branch information
rossgrambo committed Oct 23, 2024
commit e53aeb000bfebc800b12865aa18a6872e1c0c669
2 changes: 1 addition & 1 deletion src/Microsoft.FeatureManagement/FeatureManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private async ValueTask<EvaluationEvent> EvaluateFeature<TContext>(string featur
Activity.Current != null &&
Activity.Current.IsAllDataRequested)
{
TelemetryEventHandler.HandleEvaluationEvent(evaluationEvent, Logger);
FeatureEvaluationTelemetry.Publish(evaluationEvent, Logger);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.FeatureManagement.Telemetry
{
internal static class TelemetryEventHandler
internal static class FeatureEvaluationTelemetry
{
private static readonly string EvaluationEventVersion = "1.0.0";

Expand All @@ -15,10 +15,22 @@ internal static class TelemetryEventHandler
/// </summary>
/// <param name="evaluationEvent">The <see cref="EvaluationEvent"/> to publish as an <see cref="ActivityEvent"/></param>
/// <param name="logger">Optional logger to log warnings to</param>
public static void HandleEvaluationEvent(EvaluationEvent evaluationEvent, ILogger logger)
public static void Publish(EvaluationEvent evaluationEvent, ILogger logger)
{
Debug.Assert(evaluationEvent != null);
Debug.Assert(evaluationEvent.FeatureDefinition != null);
if (Activity.Current == null)
{
throw new InvalidOperationException("An Activity must be created before calling this method.");
}

if (evaluationEvent == null)
{
throw new ArgumentNullException(nameof(evaluationEvent));
}

if (evaluationEvent.FeatureDefinition == null)
{
throw new ArgumentNullException(nameof(evaluationEvent.FeatureDefinition));
}

var tags = new ActivityTagsCollection()
{
Expand Down