Skip to content

Commit a433b5f

Browse files
committed
Addressing comments and updating query
1 parent 096862c commit a433b5f

File tree

1 file changed

+77
-76
lines changed

1 file changed

+77
-76
lines changed

articles/azure-app-configuration/howto-telemetry.md

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -61,55 +61,55 @@ These types of questions can be answered through the emission and analysis of fe
6161
1. Use the time range selector to focus on specific periods to identify trends or investigate particular timeframes of interest.
6262

6363
1. Filter by feature Flag
64-
- Click on the dropdown menu above the event graph
65-
- Under **Feature flags with events** select your feature flag
66-
- The graph will now display only events related to the feature flag's evaluations
64+
1. Click on the dropdown menu above the event graph
65+
1. Under **Feature flags with events** select your feature flag
66+
1. The graph will now display only events related to the feature flag's evaluations
6767
> [!div class="mx-imgBorder"]
6868
> ![Screenshot of the Azure portal, selecting specific feature flag in application insights blade of App Configuration resource.](./media/howto-telemetry/app-insights-ff-dropdown.png)
6969
7070
1. To access more detailed telemetry, click **View details** to open the telemetry tab.
7171
> [!div class="mx-imgBorder"]
7272
> ![Screenshot of the Azure portal, navigate to telemetry tab from app insights blade of App Configuration resource.](./media/howto-telemetry/app-insights-view-details-link.png)
7373
74-
You can also access this tab by going to the **Feature manager** and clicking **View events** in the telemetry column for the feature flag of interest.
75-
> [!div class="mx-imgBorder"]
76-
> ![Screenshot of the Azure portal, view events from feature manager.](./media/howto-telemetry/feature-manager-view-events.png)
74+
> [!NOTE]
75+
> You can also access this tab by going to the **Feature manager** and clicking **View events** in the telemetry column for the feature flag of interest.
76+
> ![Screenshot of the Azure portal, view events from feature manager.](./media/howto-telemetry/feature-manager-view-events.png)
7777
7878

79-
In the telemetry tab, you can view:
79+
### Verify variant assignments
8080

81-
- **Total events**: Total number of evaluation events emitted by your application
82-
- **Unique users**: Number of distinct users who were targeted and for whom events were emitted.
83-
81+
In the telemetry tab, you can view:
8482

83+
- **Total events**: Total number of evaluation events emitted by your application
84+
- **Unique users**: Number of distinct users who were targeted and for whom events were emitted.
8585

86-
**Verify variant assignments**
87-
88-
In order to show the distribution of users and number of evaluations across Simple, Long, and None variants, group the metrics by Variant. This grouping enables you to see whether the configured allocations are working as expected, and that all expected variants are being served to users.
86+
In order to show the distribution of users and number of evaluations across Simple, Long, and None variants, group the metrics by Variant. This grouping enables you to see whether the configured allocations are working as expected, and that all expected variants are being served to users.
8987

90-
> [!div class="mx-imgBorder"]
91-
> ![Screenshot of the Azure portal, view unique users by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant.png)
88+
> [!div class="mx-imgBorder"]
89+
> ![Screenshot of the Azure portal, view unique users by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant.png)
9290
93-
In this example, we see that the number of users assigned the "None" variant is almost twice that of the "Simple" and "Long" variants given the configured 50-25-25 percentile split between "None", "Simple" and "Long" respectively.
91+
In this example, we see that the number of users assigned the "None" variant is almost twice that of the "Simple" and "Long" variants given the configured 50-25-25 percentile split between "None", "Simple" and "Long" respectively.
9492

9593

96-
**Confirm overrides and behavior based on flag state**
97-
- Users may receive a variant for different reasons. You want to ensure that your variant assignments aren't only in the right proportion, but also for the right reason. You can group metrics by assignment reason. In this example, we see that the only assignment reason is solely due to Percentile allocations.
94+
### Confirm overrides and behavior based on flag state
9895

99-
> [!div class="mx-imgBorder"]
100-
> ![Screenshot of the Azure portal, view total events by assignment reason in telemetry tab.](./media/howto-telemetry/unique-user-count-by-assignment-reason.png)
96+
Users may receive a variant for different reasons. You want to ensure that your variant assignments aren't only in the right proportion, but also for the right reason. You can group metrics by assignment reason. In this example, we see that the only assignment reason is solely due to Percentile allocations.
10197

102-
- Disable the feature flag by going to the feature manager and toggling the feature flag "Enable" switch.
103-
- In the telemetry column, click **View events** to go to telemetry tab in read-only mode.
104-
- View Unique user count by Variant. You should see that all assignments for Long and Simple go to zero. Only the None variant, which is the default in our case, is assigned to users.
105-
> [!div class="mx-imgBorder"]
106-
> ![Screenshot of the Azure portal, view unique user count by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant-disabled.png)
98+
> [!div class="mx-imgBorder"]
99+
> ![Screenshot of the Azure portal, view total events by assignment reason in telemetry tab.](./media/howto-telemetry/unique-user-count-by-assignment-reason.png)
107100
108-
- Switch to view unique user count by assignment reason.
109-
Confirm from the graph that the Percentile allocations fall to zero and DefaultWhenDisabled is the only reason for which users are being assigned variants.
110-
- Other possible reasons include "Group Override" or "User Override" if configured.
111-
> [!div class="mx-imgBorder"]
112-
> ![Screenshot of the Azure portal, view unique user count by assignment reason in telemetry tab.](./media/howto-telemetry/unique-user-count-by-assignment-reason-disabled.png)
101+
- Disable the feature flag by going to the feature manager and toggling the feature flag "Enable" switch.
102+
- In the telemetry column, click **View events** to go to telemetry tab in read-only mode.
103+
- View Unique user count by Variant. You should see that all assignments for Long and Simple go to zero. Only the None variant, which is the default in our case, is assigned to users.
104+
> [!div class="mx-imgBorder"]
105+
> ![Screenshot of the Azure portal, view unique user count by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant-disabled.png)
106+
107+
- Switch to view unique user count by assignment reason.
108+
Confirm from the graph that the Percentile allocations fall to zero and DefaultWhenDisabled is the only reason for which users are being assigned variants.
109+
110+
Other possible reasons include "Group Override" or "User Override" if configured.
111+
> [!div class="mx-imgBorder"]
112+
> ![Screenshot of the Azure portal, view unique user count by assignment reason in telemetry tab.](./media/howto-telemetry/unique-user-count-by-assignment-reason-disabled.png)
113113
114114

115115
## Analyze in Application Insights
@@ -118,53 +118,54 @@ Now that you have confirmed the feature flag allocations are working as expected
118118

119119
1. Open your Application Insights resource in the Azure portal and select **Logs** under **Monitoring**. In the query window, run the following query to see the telemetry events:
120120

121-
```kusto
122-
// Step 1: Get distinct users and their Variant from FeatureEvaluation
123-
let evaluated_users =
124-
customEvents
125-
| where name == "FeatureEvaluation"
126-
| where tostring(customDimensions.FeatureFlagReference) == "https://<store-endpoint>/kv/.appconfig.featureflag/<feature-flag-name>?label=<feature-flag-label>"
127-
| extend TargetingId = tostring(customDimensions.TargetingId),
128-
Variant = tostring(customDimensions.Variant)
129-
| summarize Variant = any(Variant) by TargetingId;
130-
131-
// Step 2: Get distinct users who emitted a "Like"
132-
let liked_users =
133-
customEvents
134-
| where name == "Liked"
135-
| extend TargetingId = tostring(customDimensions.TargetingId)
136-
| summarize by TargetingId;
137-
138-
// Step 3: Join them to get only the evaluated users who also liked
139-
let hearted_users =
140-
evaluated_users
141-
| join kind=inner (liked_users) on TargetingId
142-
| summarize HeartedUsers = dcount(TargetingId) by Variant;
143-
144-
// Step 4: Total evaluated users per variant
145-
let total_users =
146-
evaluated_users
147-
| summarize TotalUsers = dcount(TargetingId) by Variant;
148-
149-
// Step 5: Combine results
150-
let combined_data =
151-
total_users
152-
| join kind=leftouter (hearted_users) on Variant
153-
| extend HeartedUsers = coalesce(HeartedUsers, 0)
154-
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
155-
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
156-
157-
// Step 6: Add total row
158-
let total_sum =
159-
combined_data
160-
| summarize Variant="All", TotalUsers = sum(TotalUsers), HeartedUsers = sum(HeartedUsers);
161-
162-
// Step 7: Output
121+
```kusto
122+
// Step 1: Get distinct users and their Variant from FeatureEvaluation (Replace <store-endpoint> with your store's endpoint)
123+
let evaluated_users =
124+
customEvents
125+
| where name == "FeatureEvaluation"
126+
| where tostring(customDimensions.FeatureFlagReference) == "https://<store-endpoint>/kv/.appconfig.featureflag/Greeting"
127+
| extend TargetingId = tostring(customDimensions.TargetingId),
128+
Variant = tostring(customDimensions.Variant)
129+
| summarize Variant = any(Variant) by TargetingId;
130+
131+
// Step 2: Get distinct users who emitted a "Like"
132+
let liked_users =
133+
customEvents
134+
| where name == "Liked"
135+
| extend TargetingId = tostring(customDimensions.TargetingId)
136+
| summarize by TargetingId;
137+
138+
// Step 3: Join them to get only the evaluated users who also liked
139+
let hearted_users =
140+
evaluated_users
141+
| join kind=inner (liked_users) on TargetingId
142+
| summarize HeartedUsers = dcount(TargetingId) by Variant;
143+
144+
// Step 4: Total evaluated users per variant
145+
let total_users =
146+
evaluated_users
147+
| summarize TotalUsers = dcount(TargetingId) by Variant;
148+
149+
// Step 5: Combine results
150+
let combined_data =
151+
total_users
152+
| join kind=leftouter (hearted_users) on Variant
153+
| extend HeartedUsers = coalesce(HeartedUsers, 0)
154+
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
155+
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
156+
157+
// Step 6: Add total row
158+
let total_sum =
163159
combined_data
164-
| union (total_sum)
165-
```
166-
> [!div class="mx-imgBorder"]
167-
> ![Screenshot of the Azure portal, view results of application insights analysis.](./media/howto-telemetry/application-insights-query-results.png)
160+
| summarize Variant="All", TotalUsers = sum(TotalUsers), HeartedUsers = sum(HeartedUsers);
161+
162+
// Step 7: Output
163+
combined_data
164+
| union (total_sum)
165+
```
166+
167+
> [!div class="mx-imgBorder"]
168+
> ![Screenshot of the Azure portal, view results of application insights analysis.](./media/howto-telemetry/application-insights-query-results.png)
168169
169170
You see one "FeatureEvaluation" event for each time the quote page was loaded and one "Liked" event for each time the like button was clicked. The "FeatureEvaluation" events have a custom property called `FeatureName` with the name of the feature flag that was evaluated. Both events have a custom property called `TargetingId` with the name of the user that liked the quote.
170171

0 commit comments

Comments
 (0)