For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Create a Metric

Create a metric in Harness FME to measure the impact of a feature flag on your key business and engineering outcomes.

A metric is a measurement of success for your experiment across your website, application, or backend services. Metrics can help you understand whether a feature flag improves, degrades, or has no measurable impact on customer behavior or experience.

Metrics are calculated using impressions and events:

  • Impressions occur when a visitor is assigned a treatment for a feature flag.

  • Events capture actions or measurements such as clicks, views, purchases, or performance data.

Once metrics are attached to feature flags and event data is flowing, you can confidently evaluate experiments, manage risk, and make data-driven product decisions in Harness FME.

You can create a metric, configure alerts, and analyze impact in six steps:

Define your metric name and information

To create a metric in Harness FME:

  1. Navigate to the Metrics page from the Harness FME navigation menu and click + Create metric.

  2. Provide the following information:

    • Name: Enter a descriptive metric name.

    • Owners: Select one or more Harness FME users as metric owners. Owners can filter metrics using Owned by me.

    • Tags: Optionally, add tags to help organize metrics by team, feature, or release.

    • Description: Optionally, describe what the metric measures and why it exists.

    • Metric category: Select None (default) or Guardrail, which applies account-wide alerting settings. Go to Metric categories to review the available categories.

Define your metric definition

The metric definition determines how Harness FME calculates the metric and which direction counts as an improvement. To define your metric:

  1. In the Select the desired impact field, select whether you want this metric to increase or decrease. Select increase if a higher measurement is good for your business and customer experience, and decrease if it is not. In most A/B testing tools, this is the winning direction.

  2. In the Select traffic type field, select the traffic type of the event you want to measure. This is the traffic type you specify when you send the event to Harness FME, and it is also the traffic type defined for the feature flags that show the metric results on the Metrics impact tab. The traffic type for the metric must match the traffic type for the feature flag you want it applied to. Go to Traffic types to review how traffic types are defined.

  3. In the Measured as field, select the type of calculation to perform on the event, the event value, or an event property. These functions are performed per your traffic type. Go to Statistical comparison (Measured per user) for each available function and an example of its use.

  4. In the Event field, select an event type to use in the metric calculation. To use more than one event in the metric, click Add event. To filter the selected event by a property, click Add new filter. For example, to count page views from California, select an event called page.view with a property filter of state matches California. You can use RE2 syntax for regular expressions in your filter.

  5. In the Value field, optionally select the property to use as the value field. For a sum or average metric, you can select either the event value or a property value for the calculation. Go to Event properties to review the available properties.

  6. In the Properties field, optionally define the event properties to filter by when measuring this metric. Go to Event properties to review the available properties.

Statistical comparison (Measured per user)

When calculating metrics per user, each user's individual contribution is calculated first. Each user then adds a single data point to the distribution of the user metric results, so every user carries the same weight in the result. Harness FME uses the resulting distribution for statistical testing of the metrics below.

All the examples assume that users are used for the traffic type in the experiment, and that the users were exposed to a particular treatment of a particular feature flag version. Where the examples state "for each user", the same logic applies to whichever traffic type you are using at the time.

Go to Metric types for an extended description of how each function behaves as an experiment runs.

Function
Description
Example

Count of events per [traffic type]

For each traffic type, the number of times they perform an event is calculated.

Measure the average number of times a user visits your website. Measure the average number of support tickets a user files with your support team.

Sum of event values per [traffic type]

For each traffic type, the sum of their event values is calculated.

Measure the total value of items purchased by a user. Measure the total number of minutes a user listened to media on your website.

Average of the event values per [traffic type]

For each traffic type, the average value of the user's events is calculated.

Measure the average value of items a user purchases. Measure the average page load time a user experiences.

Ratio of two events per [traffic type]

For each traffic type, the ratio of the number of times two different events are performed is calculated.

Measure the number of hotel searches that occur for a user to make a hotel booking. Measure the number of invites sent for a user to accept the invite.

Percent of unique [traffic type]

The number of distinct traffic types that performed the event as a percent of those in the sample is calculated.

Measure what percent of your sample size clicked the checkout button. Measure the percent of users who filed a support ticket.

Advanced metric settings

In the Advanced section of a metric definition, optionally apply the following settings:

  • Filter by: Restrict the customers counted in the metric to those who triggered another event.

    • No filter criteria: No filters are applied.

    • Has done the following event prior to the metric event: Counts customers who triggered the filter event at least once during the version of a feature flag, as long as it happened within the same feature flag version and before the metric event. For example, to measure the count of add to cart events that happened after a customer viewed the special offers page, select Added to cart for the metric event and Viewed special offers page for the filter event.

    • Has done the following event (not ordered): Counts customers who triggered the filter event at least once during the version of a feature flag. As long as a customer triggered the event within the same feature flag version, the filter applies even if the event happened after the metric event. For example, to measure the count of add to cart events that happened either before or after a customer subscribed to the newsletter, select Added to cart for the metric event and Subscribed to newsletter for the filter event.

    • Properties: Optionally apply a property filter to the event you are filtering the metric by.

  • Cap at: Apply a cap to your metric value to reduce the impact of outliers. Capping replaces outlier values in your metric with a fixed threshold value, which reduces the variance and increases the sensitivity of the metric.

    When a metric cap is set to per user per day, the day is the 24 hours from a user's first impression within a particular version of a feature flag.

Create an alert policy

An alert policy allows you to configure a degradation threshold for your metric. If the feature flag causes the metric to go below or above that threshold, you are alerted through your configured notification channel. Go to Alert policies to create one.

Manage alerts

Any alerts that are triggered are displayed on both the Targeting tab and the Alerts tab on the feature flag page. When you receive an alert, you can roll the feature flag back by clicking kill, or you can dismiss the alert. Go to Creating a metric alert policy to configure what triggers an alert and who is notified.

Review metrics impact during a review period

The review periods are preset in the admin settings. To access your metrics impact, search for the feature flag you want to see the impact for and go to its Metrics impact tab. The impact on your metrics is ordered by feature flag key metrics first, then account-wide guardrail metrics, and then feature flag supporting metrics. Go to Review period check to understand how the review period is applied, and to Filtering your metrics to narrow the results.

Information such as the impact %, the p-value, and the error margin is surfaced on the metric card. Click the metric card to access additional information, including how the impact changed over time, the metric dispersion, and the sample size used to calculate the metric value. Go to Understanding results to interpret these values.

Audit logs

Audit logs are captured every time the metric's definition or alert policy is changed. Go to Audit logs to review the captured changes.

For an interactive onboarding experience including further use cases and features like events, metrics, and monitoring and alerting, go to the Harness Feature Management & Experimentation Advanced Feature Flagging for Engineers certification.

Last updated

Was this helpful?