Skip to content

Commit aec4f7e

Browse files
update
1 parent 5e6a404 commit aec4f7e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

articles/azure-app-configuration/feature-management-dotnet-reference.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,18 @@ The `telemetry` section of a feature flag has the following properties:
13641364

13651365
### Custom Telemetry Publishing
13661366

1367-
The feature manager has its own `ActivitySource` with name "Microsoft.FeatureManagement". If `telemetry` is enabled for a feature flag, whenever the evaluation of this feature flag is started, the feature manager will start an `Activity`. When the feature flag evaluation is finished, the feature manager will add an `ActivityEvent` called "FeatureFlag" to the `Activity.Current`. The "FeatureFlag" event will have tags which include the information about the feature flag evaluation. Specifically, the tags will include the "FeatureName", "Enabled", "Variant", "VariantAssignmentReason", "TargetingId" and all key value pairs specified in `telemetry.metadata` of the feature flag.
1367+
The feature manager has its own `ActivitySource` with name "Microsoft.FeatureManagement". If `telemetry` is enabled for a feature flag, whenever the evaluation of this feature flag is started, the feature manager will start an `Activity`. When the feature flag evaluation is finished, the feature manager will add an `ActivityEvent` called "FeatureFlag" to the `Activity.Current`. The "FeatureFlag" event will have tags which include the information about the feature flag evaluation. Specifically, the tags will include the following fields:
1368+
1369+
| Tag | Description |
1370+
| ---------------- | ---------------- |
1371+
| `FeatureName` | The feature flag name. |
1372+
| `Enabled` | Whether the feature flag is evaluated as enabled. |
1373+
| `Variant` | The assigned variant. |
1374+
| `VariantAssignmentReason` | The reason why the variant is assigned. |
1375+
| `TargetingId` | The user id used for targeting. |
1376+
1377+
> [!NOTE]
1378+
> All key value pairs specified in `telemetry.metadata` of the feature flag will also be included in the tags.
13681379

13691380
To enable custom telemetry publishing, you can create an [`ActivityListener`](/dotnet/api/system.diagnostics.activitylistener) and listen to the `Microsoft.FeatureManagement` activity source. Here is an example showing how to listen to the feature management activity source and add a callback when a feature is evaluated.
13701381

@@ -1414,7 +1425,7 @@ app.UseMiddleware<TargetingHttpContextMiddleware>();
14141425
An example of its usage can be found in the [EvaluationDataToApplicationInsights](https://github.com/microsoft/FeatureManagement-Dotnet/tree/preview/examples/EvaluationDataToApplicationInsights) example.
14151426

14161427
> [!NOTE]
1417-
> To ensure that `TargetingTelemetryInitializer` works correctly, it is essential to use `TargetingHttpContextMiddleware` in your middleware pipeline. The middleware is responsible for adding the targeting info to the current activity's baggage, which the telemetry initializer relies on.
1428+
> To ensure that `TargetingTelemetryInitializer` works as expected, the `TargetingHttpContextMiddleware` described below should be used.
14181429

14191430
#### Prerequisite
14201431

0 commit comments

Comments
 (0)