File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
src/Microsoft.FeatureManagement Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ private async ValueTask<EvaluationEvent> EvaluateFeature<TContext>(string featur
373
373
Activity . Current != null &&
374
374
Activity . Current . IsAllDataRequested )
375
375
{
376
- TelemetryEventHandler . HandleEvaluationEvent ( evaluationEvent , Logger ) ;
376
+ FeatureEvaluationTelemetry . Publish ( evaluationEvent , Logger ) ;
377
377
}
378
378
}
379
379
Original file line number Diff line number Diff line change 6
6
7
7
namespace Microsoft . FeatureManagement . Telemetry
8
8
{
9
- internal static class TelemetryEventHandler
9
+ internal static class FeatureEvaluationTelemetry
10
10
{
11
11
private static readonly string EvaluationEventVersion = "1.0.0" ;
12
12
@@ -15,10 +15,22 @@ internal static class TelemetryEventHandler
15
15
/// </summary>
16
16
/// <param name="evaluationEvent">The <see cref="EvaluationEvent"/> to publish as an <see cref="ActivityEvent"/></param>
17
17
/// <param name="logger">Optional logger to log warnings to</param>
18
- public static void HandleEvaluationEvent ( EvaluationEvent evaluationEvent , ILogger logger )
18
+ public static void Publish ( EvaluationEvent evaluationEvent , ILogger logger )
19
19
{
20
- Debug . Assert ( evaluationEvent != null ) ;
21
- Debug . Assert ( evaluationEvent . FeatureDefinition != null ) ;
20
+ if ( Activity . Current == null )
21
+ {
22
+ throw new InvalidOperationException ( "An Activity must be created before calling this method." ) ;
23
+ }
24
+
25
+ if ( evaluationEvent == null )
26
+ {
27
+ throw new ArgumentNullException ( nameof ( evaluationEvent ) ) ;
28
+ }
29
+
30
+ if ( evaluationEvent . FeatureDefinition == null )
31
+ {
32
+ throw new ArgumentNullException ( nameof ( evaluationEvent . FeatureDefinition ) ) ;
33
+ }
22
34
23
35
var tags = new ActivityTagsCollection ( )
24
36
{
You can’t perform that action at this time.
0 commit comments