Skip to main content
Proper environment tracking helps you separate dev/staging/production traffic, compare performance across environments, and prevent production issues.

The Problem

Without environment tracking:
  • Development requests pollute production metrics
  • Can’t compare staging vs. production performance
  • Difficult to test changes before production rollout
  • Cost analytics include test/dev spending
  • Alerts trigger on development errors

The Solution

Use Helicone’s custom properties to track environments and segment your data.

Implementation

1. Add Environment Headers

Tag every request with its environment:

2. Add Version Tracking

Track code version to identify issues:
Version tracking helps identify when issues started and compare performance between releases.

3. Environment-Specific Configuration

Different settings per environment:

Dashboard Usage

Filter by Environment

1

Navigate to Dashboard

2

Apply Environment Filter

Now all metrics show only production data:
  • Total requests
  • Cost
  • Error rate
  • Latency
3

Compare Environments

Open multiple browser tabs:
  • Tab 1: Filter by Environment = production
  • Tab 2: Filter by Environment = staging
  • Tab 3: Filter by Environment = development
Compare metrics side-by-side.

Environment-Specific Alerts

Create separate alerts per environment:
Configuration:
  • Name: Production Error Rate
  • Metric: Error Rate
  • Threshold: > 2% (strict)
  • Time Window: 5 minutes
  • Filter: Environment = production
  • Notifications: Slack #production-alerts, PagerDuty

Use Cases

1. Pre-Production Testing

Test prompt changes in staging before production:
Compare in Helicone:

2. Cost Tracking by Environment

See where money is being spent:
Example output:

3. Debugging Production Issues

When production has issues:
1

Filter to Production

2

Check Recent Deployments

3

Test Fix in Staging

Deploy fix to staging:
4

Roll Out to Production

After staging validation:

4. A/B Testing Across Environments

Test different approaches:

Best Practices

Use consistent naming: Stick to “development”, “staging”, “production” across all services
Set environment at startup: Configure once when app starts, not per request
Different models per environment: Use cheaper models in dev/staging to reduce costs
Separate Helicone projects: For strict separation, create separate Helicone projects per environment
Always validate Environment property is set correctly. Missing environments will be hard to filter.

Advanced: Multi-Region Environments

Track both environment and region:

Environment Tracking Checklist

  • Environment property added to all requests
  • Version/commit tracking enabled
  • Environment-specific configurations (model, caching, etc.)
  • Separate alerts per environment
  • Dashboard views filtered by environment
  • Cost tracking separated by environment
  • Staging environment exists and used for testing
  • Team knows which environment they’re working in

Example: Complete Setup

Next Steps

Custom Properties

Learn more about custom properties

Production Monitoring

Set up comprehensive production monitoring

Cost Tracking

Track costs by environment

Alerts

Configure environment-specific alerts