Skip to main content
Sentry’s feature flag tracking helps you understand how feature flags correlate with errors and performance issues, making it easier to identify problematic feature rollouts.

Setup

Enable feature flag tracking with the integration:
The feature flags integration automatically tracks flag evaluations and includes them with error events and spans.

Recording Flag Evaluations

Manually record feature flag evaluations:

Recording Multiple Flags

Integration with Feature Flag Services

LaunchDarkly

Split.io

GrowthBook

Sentry provides built-in GrowthBook integration:
Use the GrowthBook integration for automatic flag tracking without manual instrumentation.

Feature Flag Context

Flags are automatically added to error and performance events:

Flags on Spans

Flags are also attached to performance spans:
Up to 10 unique flags per span are recorded. Additional flags are silently dropped.

Flag Buffer

Sentry maintains a buffer of the last 100 flag evaluations:

Flag Buffer Behavior

  • LRU (Least Recently Used): Old flags are removed when buffer is full
  • Unique flags: Re-evaluating a flag updates its value
  • Ordered: Flags are sorted by recency

Practical Examples

A/B Testing

Progressive Rollout

Feature Gating

Conditional Features

Analyzing Flag Impact

In Sentry, you can:
  1. Filter issues by flags: See errors that occurred when a flag was enabled
  2. Compare performance: Measure performance impact of flags
  3. Correlate with releases: Track flag changes across releases
  4. Group by flags: Aggregate errors by flag combinations

Example Queries

Best Practices

  1. Record early: Track flags before using them
  2. Use descriptive names: Clear flag names help debugging
  3. Track all evaluations: Record flags even if they’re false
  4. Include experiments: Track A/B test variants as flags
  5. Clean up old flags: Remove tracking for deprecated flags
  6. Monitor flag impact: Watch error rates when enabling flags

Custom Integration

Create a wrapper for your feature flag service:

TypeScript Support

Troubleshooting

Flags Not Appearing

Too Many Flags

Next Steps

Error Monitoring

See how flags impact errors

Performance

Measure flag performance impact

Context

Learn about context data

User Feedback

Collect feedback on new features