Skip to main content

Monitoring Metrics & Anomalies

Learn how to monitor feature usage, track business metrics, and detect anomalies in Toggly.

Metrics Dashboard​

The Metrics dashboard provides real-time and historical views of your feature usage and business metrics.

Key Metrics​

  • Feature Usage: How often features are evaluated
  • Enable Rate: Percentage of evaluations that returned enabled
  • Variant Distribution: Distribution of variants for multi-variant flags
  • User Coverage: Percentage of users who saw the feature
  • Business Metrics: Custom metrics you track

Feature Usage Metrics​

Evaluation Count​

Total number of times a feature was evaluated:

Feature: new-checkout-flow
Evaluations (24h): 125,430
Trend: +15% vs previous day

Enable Rate​

Percentage of evaluations that returned enabled:

Feature: new-checkout-flow
Enable Rate: 25.3%
Total Evaluations: 125,430
Enabled Evaluations: 31,750

User Coverage​

We track active usage by counting unique users who actually engaged with the feature (evaluated it as enabled and proceeded to use it), not just those who were potentially eligible.

Feature: new-checkout-flow
User Coverage: 18.5%
Total Users: 500,000
Users Who Used Feature: 92,500

Business Metrics​

Track custom business metrics to measure feature impact:

Conversion Rate​

Percentage of users who convert:

private readonly IMetricsService _metricsService;

public CheckoutController(IMetricsService metricsService)
{
_metricsService = metricsService;
}

[HttpPost]
public async Task<IActionResult> CompletePurchase()
{
// ... process purchase ...

// Track conversion event (Measurement)
await _metricsService.MeasureAsync("purchase_completed", 1);

return Ok();
}

Revenue​

Total revenue generated:

[HttpPost]
public async Task<IActionResult> CompletePurchase(Order order)
{
// ... process purchase ...

// Track revenue (Measurement)
await _metricsService.MeasureAsync("revenue", (double)order.TotalAmount);

return Ok();
}

Basket Size​

Track distributions of values, like items in a cart:

// Track number of items in cart (Observation)
await _metricsService.ObserveAsync("cart_items_count", cart.Items.Count);

Counters​

Simple counters for events:

// Increment counter
await _metricsService.IncrementCounterAsync("api_calls", 1);

Anomaly Detection​

Toggly automatically detects anomalies in your metrics:

Types of Anomalies​

  • Sudden Spikes: Unusual increases in feature usage
  • Drops: Unexpected decreases in metrics
  • Pattern Changes: Shifts in user behavior
  • Error Rate Increases: Spikes in tracked application errors

Anomaly Alerts​

When anomalies are detected:

  1. Dashboard Alerts: Visual indicators in the dashboard
  2. Email Notifications: Optional email alerts
  3. Webhook Notifications: Real-time webhook calls

Responding to Anomalies​

When an anomaly is detected:

  1. Review the Alert: Check what changed
  2. Investigate Root Cause: Look for recent changes
  3. Check Related Metrics: See if other metrics are affected
  4. Take Action: Disable feature if needed, or investigate further

Setting Up Monitoring​

Key Metrics to Monitor​

  • Error Counts: Exceptions or failures tracked in your application
  • Performance: Latency and response times
  • Business Metrics: Conversion rates, revenue
  • Feature Usage: Evaluation counts and enable rates

Creating Alerts​

Configure alerts for:

  1. Navigate to Settings → Alerts
  2. Click Create Alert
  3. Select metric and threshold
  4. Choose notification method
  5. Save the alert

Alert Examples​

# Error rate alert
Metric: error_rate
Threshold: > 1%
Action: Email + Dashboard

# Performance alert
Metric: p95_latency
Threshold: > 500ms
Action: Email + Webhook

# Business metric alert
Metric: conversion_rate
Threshold: < -10% (decrease)
Action: Email + Dashboard

Metrics Best Practices​

1. Track Key Metrics​

Focus on metrics that matter to your business:

  • Revenue
  • Conversion rates
  • User engagement
  • Exception rates

2. Set Up Alerts​

Configure alerts for critical metrics to catch issues early.

3. Review Regularly​

Review metrics daily to understand trends and catch issues.

4. Compare Across Features​

Compare metrics across features to identify patterns.

5. Use Historical Data​

Look at historical trends to understand normal patterns.

Next Steps​