Skip to content

Commit 53b508d

Browse files
committed
WIP (Update images)
1 parent 8b8e49d commit 53b508d

10 files changed

+121
-136
lines changed

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

Lines changed: 4 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -91,82 +91,13 @@ In this tutorial, you use telemetry in your Node.js application to track feature
9191
export APPLICATIONINSIGHTS_CONNECTION_STRING='applicationinsights-connection-string'
9292
```
9393
94-
1. Run the application, [see step 4 of Use variant feature flags](./howto-variant-feature-flags-javascript.md#run-the-application).
95-
96-
1. Create 10 different users and log into the application. As you log in with each user, you get a different message variant for some of them. ~50% of the time you get no message. 25% of the time you get the message "Hello!" and 25% of the time you get "I hope this makes your day!"
97-
98-
1. With some of the users click the **Like** button to trigger the telemetry event.
99-
100-
> [!div class="mx-imgBorder"]
101-
> ![Screenshot of the application with like button clicked.](./media/howto-telemetry-javascript/like-button.png)
102-
103-
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:
104-
105-
```kusto
106-
// Step 1: Get distinct users and their Variant from FeatureEvaluation
107-
let evaluated_users =
108-
customEvents
109-
| where name == "FeatureEvaluation"
110-
| extend TargetingId = tostring(customDimensions.TargetingId),
111-
Variant = tostring(customDimensions.Variant)
112-
| summarize Variant = any(Variant) by TargetingId;
113-
114-
// Step 2: Get distinct users who emitted a "Like"
115-
let liked_users =
116-
customEvents
117-
| where name == "Liked"
118-
| extend TargetingId = tostring(customDimensions.TargetingId)
119-
| summarize by TargetingId;
120-
121-
// Step 3: Join them to get only the evaluated users who also liked
122-
let hearted_users =
123-
evaluated_users
124-
| join kind=inner (liked_users) on TargetingId
125-
| summarize HeartedUsers = dcount(TargetingId) by Variant;
126-
127-
// Step 4: Total evaluated users per variant
128-
let total_users =
129-
evaluated_users
130-
| summarize TotalUsers = dcount(TargetingId) by Variant;
131-
132-
// Step 5: Combine results
133-
let combined_data =
134-
total_users
135-
| join kind=leftouter (hearted_users) on Variant
136-
| extend HeartedUsers = coalesce(HeartedUsers, 0)
137-
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
138-
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
139-
140-
// Step 6: Add total row
141-
let total_sum =
142-
combined_data
143-
| summarize
144-
TotalUsers = sum(TotalUsers),
145-
HeartedUsers = sum(HeartedUsers)
146-
| extend
147-
Variant = "All",
148-
PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
149-
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
150-
151-
// Step 7: Output
152-
combined_data
153-
| union (total_sum)
154-
```
155-
156-
> [!div class="mx-imgBorder"]
157-
> ![Screenshot of Application Insights showing the results table with four rows; All, Simple, Long, and None with their respective user counts and percentages.](./media/howto-telemetry-javascript/telemetry-results.png)
94+
1. Run the application, [see step 2 of Use variant feature flags](./howto-variant-feature-flags-python.md#build-and-run-the-app). You can simulate user activity on the application where some users are served different variants that they may or may not like.
15895
159-
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" event has 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.
96+
## Next steps
16097
161-
For more information about the "FeatureEvaluation" event, go to the [Feature flag telemetry reference](./feature-flag-telemetry-reference.md)
98+
- Now that you have set up your app and have some user activity on it, you can [review feature flag telemetry in the Azure Portal](./howto-telemetry.md#review-telemetry-for-feature-flag).
16299
163100
## Additional resources
164101
165102
- [Quote of the Day sample](https://github.com/Azure-Samples/quote-of-the-day-javascript)
166-
167-
## Next steps
168-
169-
For the full feature rundown of the JavaScript feature management library, refer to the following document.
170-
171-
> [!div class="nextstepaction"]
172-
> [JavaScript Feature Management](./feature-management-javascript-reference.md)
103+
- For the full feature rundown of the JavaScript feature management library you can refer to the [JavaScript Feature Management reference documentation](./feature-management-javascript-reference.md)

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

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -105,70 +105,10 @@ In this tutorial, you use telemetry in your Python application to track feature
105105
export APPLICATIONINSIGHTS_CONNECTION_STRING='applicationinsights-connection-string'
106106
```
107107
108-
1. Run the application, [see step 2 of Use variant feature flags](./howto-variant-feature-flags-python.md#build-and-run-the-app).
109-
110-
1. Create 10 different users and log into the application. As you log in with each user, you get a different message variant for some of them. ~50% of the time you get no message. 25% of the time you get the message "Hello!" and 25% of the time you get "I hope this makes your day!".
111-
112-
1. With some of the users select the **Like** button to trigger the telemetry event.
113-
114-
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:
115-
116-
```kusto
117-
// Step 1: Get distinct users and their Variant from FeatureEvaluation
118-
let evaluated_users =
119-
customEvents
120-
| where name == "FeatureEvaluation"
121-
| extend TargetingId = tostring(customDimensions.TargetingId),
122-
Variant = tostring(customDimensions.Variant)
123-
| summarize Variant = any(Variant) by TargetingId;
124-
125-
// Step 2: Get distinct users who emitted a "Like"
126-
let liked_users =
127-
customEvents
128-
| where name == "Liked"
129-
| extend TargetingId = tostring(customDimensions.TargetingId)
130-
| summarize by TargetingId;
131-
132-
// Step 3: Join them to get only the evaluated users who also liked
133-
let hearted_users =
134-
evaluated_users
135-
| join kind=inner (liked_users) on TargetingId
136-
| summarize HeartedUsers = dcount(TargetingId) by Variant;
137-
138-
// Step 4: Total evaluated users per variant
139-
let total_users =
140-
evaluated_users
141-
| summarize TotalUsers = dcount(TargetingId) by Variant;
142-
143-
// Step 5: Combine results
144-
let combined_data =
145-
total_users
146-
| join kind=leftouter (hearted_users) on Variant
147-
| extend HeartedUsers = coalesce(HeartedUsers, 0)
148-
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
149-
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
150-
151-
// Step 6: Add total row
152-
let total_sum =
153-
combined_data
154-
| summarize
155-
TotalUsers = sum(TotalUsers),
156-
HeartedUsers = sum(HeartedUsers)
157-
| extend
158-
Variant = "All",
159-
PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
160-
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
161-
162-
// Step 7: Output
163-
combined_data
164-
| union (total_sum)
108+
1. Run the application, [see step 2 of Use variant feature flags](./howto-variant-feature-flags-python.md#build-and-run-the-app). You can simulate user activity on the application where some users are served different variants that they may or may not like.
165109
166-
```
167-
168-
> [!div class="mx-imgBorder"]
169-
> ![Screenshot of Application Insights showing the results table with four rows; All, Simple, Long, and None with their respective user counts and percentages.](./media/howto-telemetry-python/telemetry-results.png)
170-
171-
You see one "FeatureEvaluation" for each time the quote page was loaded and one "Liked" event for each time the like button was clicked. The "FeatureEvaluation" event 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.
110+
## Next steps
111+
- Now that you have set up your app and have some user activity on it, you can [review feature flag telemetry in the Azure Portal](./howto-telemetry.md#review-telemetry-for-feature-flag).
172112
173113
## Additional resources
174114
- [Flask Quote of the Day sample](https://github.com/Azure-Samples/quote-of-the-day-python)

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

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,117 @@ These types of questions can be answered through the emission and analysis of fe
5151

5252
* [Python](./howto-telemetry-python.md)
5353
* [JavaScript](./howto-telemetry-javascript.md)
54+
55+
## Review telemetry for feature flag
56+
57+
1. Navigate to the Application Insights blade in your Azure portal or monitoring dashboard. You'll see a graph displaying all events from your application. This provides an initial overview of activity patterns.
58+
> [!div class="mx-imgBorder"]
59+
> ![Screenshot of the Azure portal, viewing events in application insights blade of App Configuration resource.](./media/howto-telemetry/app-insights-view-events.png)
60+
61+
1. Use the time range selector to focus on specific periods. This helps identify trends or investigate particular timeframes of interest.
62+
63+
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
67+
> [!div class="mx-imgBorder"]
68+
> ![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)
69+
70+
1. To access more detailed telemetry, click **"View details"** to open the telemetry tab.
71+
> [!div class="mx-imgBorder"]
72+
> ![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)
73+
74+
In the telemetry tab, you can view:
75+
76+
- **Total events**: Total number of evaluation events emitted by your application
77+
- **Unique users**: Number of distinct users who were targeted and for whom events were emitted.
78+
79+
80+
81+
**Verify variant assignments**
82+
83+
In order to show the distribution of users and number of evaluations across Simple, Long, and None variants, group the metrics by Variant. This will enable you see whether the configured allocations are working as expected, and that all expected variants are being served to users.
84+
85+
> [!div class="mx-imgBorder"]
86+
> ![Screenshot of the Azure portal, view total events by variant in telemetry tab.](./media/howto-telemetry/total-events-by-variant.png)
87+
88+
In this example, we see that the number of events for 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.
89+
90+
91+
**Confirm overrides and behaviour based on flag state**
92+
- Users may be assigned a variant for different reasons so you would want to ensure that your variant assignments are not only in the right proprtion, but also for the right reason. You can view this by grouping metrics by assignment reason. In this example, we will see that the only assignment reason is solely due to Percentile allocations.
93+
94+
> [!div class="mx-imgBorder"]
95+
> ![Screenshot of the Azure portal, view total events by assignment reason in telemetry tab.](./media/howto-telemetry/total-events-by-assignment-reason.png)
96+
97+
- Disable the feature flag by going to the feature manager and toggling the feature flag off. Visit your feature flag telemetry tab and view Unique user count by Variant. You will see that all assignments for Long and Simple go to zero, and only the default variant (which is None in our case) is the only variant being assigned to users.
98+
> [!div class="mx-imgBorder"]
99+
> ![Screenshot of the Azure portal, view unique user count by variant in telemetry tab.]()
100+
- Switch to group by unique user count by assignment reason.
101+
Confirm from the graph that the Percentile allocations fall to zero and DefaultWhenDisabled is the only reason for which users are being assing variants.
102+
- Other possible reasons include "Group Override" or "User Override" if configured.
103+
> [!div class="mx-imgBorder"]
104+
> ![Screenshot of the Azure portal, view unique user count by assignment reason in telemetry tab.]()
105+
106+
107+
108+
1. You can also access telemetry directly from the Feature Manager blade:
109+
- Navigate to your Feature Manager
110+
- Locate your feature flag in the displayed grid
111+
- Click **"View events"** in the Telemetry column
112+
> [!div class="mx-imgBorder"]
113+
> ![Screenshot of the Azure portal, view events from feature manager.](./media/howto-telemetry/feature-manager-view-events.png)
114+
115+
## Analyze in Application Insights
116+
117+
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:
118+
119+
```kusto
120+
// Step 1: Get distinct users and their Variant from FeatureEvaluation
121+
let evaluated_users =
122+
customEvents
123+
| where name == "FeatureEvaluation"
124+
| extend TargetingId = tostring(customDimensions.TargetingId),
125+
Variant = tostring(customDimensions.Variant)
126+
| summarize Variant = any(Variant) by TargetingId;
127+
128+
// Step 2: Get distinct users who emitted a "Like"
129+
let liked_users =
130+
customEvents
131+
| where name == "Liked"
132+
| extend TargetingId = tostring(customDimensions.TargetingId)
133+
| summarize by TargetingId;
134+
135+
// Step 3: Join them to get only the evaluated users who also liked
136+
let hearted_users =
137+
evaluated_users
138+
| join kind=inner (liked_users) on TargetingId
139+
| summarize HeartedUsers = dcount(TargetingId) by Variant;
140+
141+
// Step 4: Total evaluated users per variant
142+
let total_users =
143+
evaluated_users
144+
| summarize TotalUsers = dcount(TargetingId) by Variant;
145+
146+
// Step 5: Combine results
147+
let combined_data =
148+
total_users
149+
| join kind=leftouter (hearted_users) on Variant
150+
| extend HeartedUsers = coalesce(HeartedUsers, 0)
151+
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
152+
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
153+
154+
// Step 6: Add total row
155+
let total_sum =
156+
combined_data
157+
| summarize Variant="All", TotalUsers = sum(TotalUsers), HeartedUsers = sum(HeartedUsers);
158+
159+
// Step 7: Output
160+
combined_data
161+
| union (total_sum)
162+
```
163+
![Screenshot of the Azure portal, view results of application insights analysis.](./media/howto-telemetry/application-insights-query-results.png)
164+
165+
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" event 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.
166+
167+
In this example, we can see that, even though there were roughly the same number of users getting the Long variant vs Simple, the Simple variant appears to be performing better by a margin of 20%.
18.9 KB
Loading
3.48 KB
Loading
49.9 KB
Loading
11.5 KB
Loading
24.5 KB
Loading
23.4 KB
Loading
46.4 KB
Loading

0 commit comments

Comments
 (0)