You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-telemetry-javascript.md
+154-3Lines changed: 154 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,160 @@ ms.date: 06/25/2025
11
11
12
12
# Enable telemetry for feature flags in a Node.js application
13
13
14
-
In this tutorial, you use telemetry in your Python application to track feature flag evaluations and custom events. Telemetry allows you to make informed decisions about your feature management strategy. You utilize the feature flag with telemetry enabled created in [Enable telemetry for feature flags](./howto-telemetry.md). Before proceeding, ensure that you create a feature flag named *Greeting* in your Configuration store with telemetry enabled. This tutorial builds on top of [use variant feature flags](./howto-variant-feature-flags-python.md).
14
+
In this tutorial, you use telemetry in your Node.js application to track feature flag evaluations and custom events. Telemetry allows you to make informed decisions about your feature management strategy. You utilize the feature flag with telemetry enabled created in [Enable telemetry for feature flags](./howto-telemetry.md). Before proceeding, ensure that you create a feature flag named *Greeting* in your Configuration store with telemetry enabled. This tutorial builds on top of [Tutorial: Use variant feature flags in a Node.js application](./howto-variant-feature-flags-javascript.md).
15
15
16
16
## Prerequisites
17
17
18
-
- The variant feature flag with telemetry enabled from [Enable telemetry for feature flags](./howto-telemetry.md).
19
-
- The application from [Use variant feature flags](./howto-variant-feature-flags-python.md).
18
+
-[Enable telemetry for feature flags](./howto-telemetry.md).
19
+
-[Tutorial: Use variant feature flags in a Node.js application](./howto-variant-feature-flags-javascript.md).
featureManager = new FeatureManager(featureFlagProvider, {
54
+
onFeatureEvaluated: publishTelemetry
55
+
});
56
+
// existing code ...
57
+
```
58
+
59
+
The `publishTelemetry` callback will send telemetry data each time a feature flag is evaluated.
60
+
61
+
1. Track custom events for user interactions. Modify the `/api/like` endpoint to send telemetry data to Application Insights whenever a user likes content. This helps you analyze which feature variants perform better.
62
+
63
+
```js
64
+
server.post("/api/like", (req, res) => {
65
+
const { UserId } = req.body;
66
+
if (UserId === undefined) {
67
+
return res.status(400).send({ error: "UserId is required" });
1. Application insights requires a connection string to connect to your Application Insights resource. Set the `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable to the connection string for your Application Insights resource.
1. Run the application, [see step 4 of Use variant feature flags](./howto-variant-feature-flags-javascript.md#run-the-application).
95
+
96
+
1. Use 10 different users to visit the application. As you use a different 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**(heart) button to trigger the telemetry event.
99
+
100
+
> [!div class="mx-imgBorder"]
101
+
>
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
>
158
+
159
+
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.
160
+
161
+
## Additional resources
162
+
163
+
- [Quote of the Day sample](https://github.com/Azure-Samples/quote-of-the-day-javascript)
164
+
165
+
## Next steps
166
+
167
+
For the full feature rundown of the JavaScript feature management library, refer to the following document.
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-telemetry-python.md
+41-23Lines changed: 41 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,12 @@ ms.date: 05/06/2025
11
11
12
12
# Enable telemetry for feature flags in a Python application
13
13
14
-
In this tutorial, you use telemetry in your Python application to track feature flag evaluations and custom events. Telemetry allows you to make informed decisions about your feature management strategy. You utilize the feature flag with telemetry enabled created in [Enable telemetry for feature flags](./howto-telemetry.md). Before proceeding, ensure that you create a feature flag named *Greeting* in your Configuration store with telemetry enabled. This tutorial builds on top of [use variant feature flags](./howto-variant-feature-flags-python.md).
14
+
In this tutorial, you use telemetry in your Python application to track feature flag evaluations and custom events. Telemetry allows you to make informed decisions about your feature management strategy. You utilize the feature flag with telemetry enabled created in [Enable telemetry for feature flags](./howto-telemetry.md). Before proceeding, ensure that you create a feature flag named *Greeting* in your Configuration store with telemetry enabled. This tutorial builds on top of [Tutorial: Use variant feature flags in a Python application](./howto-variant-feature-flags-python.md).
15
15
16
16
## Prerequisites
17
17
18
18
- The variant feature flag with telemetry enabled from [Enable telemetry for feature flags](./howto-telemetry.md).
19
-
- The application from [Use variant feature flags](./howto-variant-feature-flags-python.md).
19
+
- The application from [Tutorial: Use variant feature flags in a Python application](./howto-variant-feature-flags-python.md).
20
20
21
21
## Add telemetry to your Python application
22
22
@@ -105,46 +105,64 @@ In this tutorial, you use telemetry in your Python application to track feature
1. Run the application, [see step 2 of Use variant feature flags](./howto-variant-feature-flags-python.md#build-and-run-the-app) .
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
+
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
+
110
112
1. With some of the users select the **Like** button to trigger the telemetry event.
113
+
111
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:
112
115
113
116
```kusto
114
-
// Total users
115
-
let total_users =
117
+
// Step 1: Get distinct users and their Variant from FeatureEvaluation
118
+
let evaluated_users =
116
119
customEvents
117
120
| where name == "FeatureEvaluation"
118
-
| summarize TotalUsers = count() by Variant = tostring(customDimensions.Variant);
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/howto-variant-feature-flags-python.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.topic: how-to
11
11
ms.date: 05/06/2025
12
12
---
13
13
14
-
# Use variant feature flags in a Python application
14
+
# Tutorial: Use variant feature flags in a Python application
15
15
16
16
In this tutorial, you use a variant feature flag to manage experiences for different user segments in an example application, *Quote of the Day*. You utilize the variant feature flag created in [How to variant feature flags](./howto-variant-feature-flags.md). Before proceeding, ensure you create the variant feature flag named *Greeting* in your App Configuration store.
0 commit comments