Skip to content

Commit 1fbf9da

Browse files
authored
Merge pull request #302385 from albertofori/albertofori/portalTelemetry
Adding updates for viewing portal telemetry
2 parents 927393d + d7c0cae commit 1fbf9da

12 files changed

+136
-138
lines changed

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

Lines changed: 4 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -91,82 +91,12 @@ 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)
158-
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.
94+
## Collect telemetry
16095
161-
For more information about the "FeatureEvaluation" event, go to the [Feature flag telemetry reference](./feature-flag-telemetry-reference.md)
96+
Deploy your application to begin collecting telemetry from your users. To test its functionality, you can simulate user activity by creating many test users. Each user will experience a different variant of greeting messages, and they can interact with the application by clicking the heart button to like a quote. As your user base grows, you can monitor the increasing volume of telemetry data collected in Azure App Configuration. Additionally, you can drill down into the data to analyze how each variant of the feature flag influences user behavior.
97+
- [Review telemetry results in App Configuration](./howto-telemetry.md#review-telemetry-results-in-azure-app-configuration).
16298
16399
## Additional resources
164100
165101
- [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)
102+
- 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+
## Collect telemetry
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+
Deploy your application to begin collecting telemetry from your users. To test its functionality, you can simulate user activity by creating many test users. Each user will experience a different variant of greeting messages, and they can interact with the application by clicking the heart button to like a quote. As your user base grows, you can monitor the increasing volume of telemetry data collected in Azure App Configuration. Additionally, you can drill down into the data to analyze how each variant of the feature flag influences user behavior.
111+
- [Review telemetry results in App Configuration](./howto-telemetry.md#review-telemetry-results-in-azure-app-configuration).
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: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@ ms.service: azure-app-configuration
66
author: mrm9084
77
ms.author: mametcal
88
ms.topic: how-to
9-
ms.date: 06/19/2025
9+
ms.date: 07/08/2025
1010
---
1111

1212
# Enable telemetry for feature flags
1313

14+
Telemetry is the automated process of collecting, transmitting, and analyzing data about how your application and its features are used. Enabling telemetry for feature flags offers valuable insights into the behavior and impact of feature rollouts, helping teams iterate faster, enhance user experience, detect issues early, and validate the effectiveness of new features. With telemetry, teams can answer critical questions such as:
15+
16+
- Is a feature enabled or disabled as expected?
17+
- Are specific users or groups accessing the new feature?
18+
- Is a feature causing performance regressions or errors?
19+
- What is the impact of a feature on key metrics like engagement or conversion?
20+
21+
By leveraging telemetry data, organizations can make informed, data-driven decisions, quickly identify and resolve issues, and optimize feature delivery for better business and user outcomes.
22+
1423
Telemetry is the process of collecting, transmitting, and analyzing data about the usage and performance of your application. It helps you monitor feature flag behavior and make data-driven decisions. When a feature flag change is deployed, it's often important to analyze its effect on an application. For example, here are a few questions that may arise:
1524

1625
- Are my flags enabled/disabled as expected?
@@ -51,3 +60,122 @@ These types of questions can be answered through the emission and analysis of fe
5160

5261
* [Python](./howto-telemetry-python.md)
5362
* [JavaScript](./howto-telemetry-javascript.md)
63+
64+
## Review telemetry results in Azure App Configuration
65+
66+
1. Navigate to the **Application Insights** blade in the App Configuration portal. You should see a graph displaying all events from your application. This graph provides an initial overview of activity patterns.
67+
> [!div class="mx-imgBorder"]
68+
> ![Screenshot of the Azure portal, viewing events in application insights blade of App Configuration resource.](./media/howto-telemetry/app-insights-view-events.png)
69+
70+
1. Use the time range selector to focus on specific periods to identify trends or investigate particular timeframes of interest.
71+
72+
1. Filter by feature Flag
73+
1. Click on the dropdown menu above the event graph
74+
1. Under **Feature flags with events** select your feature flag
75+
1. The graph will now display only events related to the feature flag's evaluations
76+
> [!div class="mx-imgBorder"]
77+
> ![Screenshot of the Azure portal, selecting specific feature flag in application insights blade of App Configuration resource.](./media/howto-telemetry/app-insights-feature-flag-dropdown.png)
78+
79+
1. To access more detailed telemetry, click **View details** to open the telemetry tab.
80+
> [!div class="mx-imgBorder"]
81+
> ![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)
82+
83+
> [!NOTE]
84+
> 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.
85+
> ![Screenshot of the Azure portal, view events from feature manager.](./media/howto-telemetry/feature-manager-view-events.png)
86+
87+
88+
### Verify variant assignments
89+
90+
In the telemetry tab, you can view:
91+
92+
- **Total events**: Total number of evaluation events emitted by your application
93+
- **Unique users**: Number of distinct users who were targeted and for whom events were emitted.
94+
95+
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.
96+
97+
> [!div class="mx-imgBorder"]
98+
> ![Screenshot of the Azure portal, view unique users by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant.png)
99+
100+
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.
101+
102+
103+
### Confirm overrides and behavior based on flag state
104+
105+
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.
106+
107+
> [!div class="mx-imgBorder"]
108+
> ![Screenshot of the Azure portal, view total events by assignment reason in telemetry tab.](./media/howto-telemetry/unique-user-count-by-assignment-reason.png)
109+
110+
1. Disable the feature flag by going to the feature manager and toggling the feature flag "Enable" switch.
111+
1. In the telemetry column, click **View events** to go to telemetry tab in read-only mode.
112+
1. 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.
113+
> [!div class="mx-imgBorder"]
114+
> ![Screenshot of the Azure portal, view unique user count by variant in telemetry tab.](./media/howto-telemetry/unique-user-count-by-variant-disabled.png)
115+
116+
1. Switch to view unique user count by assignment reason.
117+
Confirm from the graph that the Percentile allocations fall to zero and DefaultWhenDisabled is the only reason for which users are being assigned variants.
118+
119+
Other possible reasons include "DefaultWhenEnabled", "Group" or "User" if configured.
120+
> [!div class="mx-imgBorder"]
121+
> ![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)
122+
123+
124+
## Analyze telemetry in Application Insights
125+
126+
Now that you have confirmed the feature flag allocations are working as expected, you can dive deeper into the telemetry events to see how different variants are performing based on the likes emitted for users.
127+
128+
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:
129+
130+
```kusto
131+
// Step 1: Get distinct users and their Variant from FeatureEvaluation (Replace <store-endpoint> with your store's endpoint)
132+
let evaluated_users =
133+
customEvents
134+
| where name == "FeatureEvaluation"
135+
| where tostring(customDimensions.FeatureFlagReference) == "https://<store-endpoint>/kv/.appconfig.featureflag/Greeting"
136+
| extend TargetingId = tostring(customDimensions.TargetingId),
137+
Variant = tostring(customDimensions.Variant)
138+
| summarize Variant = any(Variant) by TargetingId;
139+
140+
// Step 2: Get distinct users who emitted a "Like"
141+
let liked_users =
142+
customEvents
143+
| where name == "Liked"
144+
| extend TargetingId = tostring(customDimensions.TargetingId)
145+
| summarize by TargetingId;
146+
147+
// Step 3: Join them to get only the evaluated users who also liked
148+
let hearted_users =
149+
evaluated_users
150+
| join kind=inner (liked_users) on TargetingId
151+
| summarize HeartedUsers = dcount(TargetingId) by Variant;
152+
153+
// Step 4: Total evaluated users per variant
154+
let total_users =
155+
evaluated_users
156+
| summarize TotalUsers = dcount(TargetingId) by Variant;
157+
158+
// Step 5: Combine results
159+
let combined_data =
160+
total_users
161+
| join kind=leftouter (hearted_users) on Variant
162+
| extend HeartedUsers = coalesce(HeartedUsers, 0)
163+
| extend PercentageHearted = strcat(round(HeartedUsers * 100.0 / TotalUsers, 1), "%")
164+
| project Variant, TotalUsers, HeartedUsers, PercentageHearted;
165+
166+
// Step 6: Add total row
167+
let total_sum =
168+
combined_data
169+
| summarize Variant="All", TotalUsers = sum(TotalUsers), HeartedUsers = sum(HeartedUsers);
170+
171+
// Step 7: Output
172+
combined_data
173+
| union (total_sum)
174+
```
175+
176+
> [!div class="mx-imgBorder"]
177+
> ![Screenshot of the Azure portal, view results of application insights analysis.](./media/howto-telemetry/application-insights-query-results.png)
178+
179+
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.
180+
181+
In this example, we can see that, even though the number of users getting the Long variant vs Simple was roughly the same, the Simple variant appears to be performing better by a margin of 22%.
18.9 KB
Loading
3.48 KB
Loading
18.9 KB
Loading
13.4 KB
Loading
24.5 KB
Loading
47.2 KB
Loading
35.2 KB
Loading

0 commit comments

Comments
 (0)