Why Use Environments?
Separating traces by environment allows you to:- Debug production issues without dev/test traces cluttering the view
- Compare performance between environments (e.g., staging vs production)
- Track costs separately for each environment
- Monitor quality at different stages of deployment
- Test changes in staging before deploying to production
Setting the Environment
Tag traces by passing theenvironment parameter when initializing the connector:
Common Environment Names
While you can use any string for the environment, these are common conventions:| Environment | Description | Use Case |
|---|---|---|
dev or development | Local development | Testing features locally |
staging | Pre-production testing | QA and integration testing |
production or prod | Live production | Real user traffic |
test | Automated testing | CI/CD pipelines |
Environment from Environment Variables
The best practice is to set the environment using theARCBEAM_ENVIRONMENT environment variable:
Multiple Environments in One Project
You can send traces from multiple environments to the same project. Each trace is tagged with its environment, so you can easily filter between them. Example setup:- Project: “Customer Support Bot”
- Environments:
dev- Your local machinestaging- Staging serverproduction- Live production server
Separate Projects vs Environments
You have two options for organizing traces:| Feature | One Project, Multiple Environments (Recommended) | Separate Projects per Environment |
|---|---|---|
| Setup Complexity | Simple - one project ID to manage | More complex - multiple project IDs to manage |
| Comparing Environments | Easy - all traces in one place | Harder - need to switch between projects |
| Data Separation | Mixed together (filterable by environment tag) | Complete separation |
| Permissions Management | Same permissions for all environments | Can set different permissions per environment |
| Cost Tracking | Manual filtering required | Cleaner separation by project |
| Use Case | Best for most teams, especially smaller projects | Best for large teams with strict environment isolation |
Option 1: One Project, Multiple Environments (Recommended)
Option 2: Separate Projects per Environment
Most teams prefer Option 1 (one project, multiple environments) because it’s simpler and makes comparisons easier.
Querying by Environment
You can query traces by environment using the Arcbeam API:- Custom dashboards
- Automated alerts
- Cost reporting by environment
Best Practices
Always Tag Production
At minimum, always tag production traces:Use Consistent Names
Pick environment names and stick with them:"producton" or "prod" vs "production".
Document Your Environment Strategy
Make it clear in your team’s docs:- Which environments exist
- What each environment is for
- How to tag traces correctly
Next Steps
View Traces
Filter and explore traces by environment
Projects
Learn about organizing with projects
Create Collections
Organize traces for team review and collaboration
Troubleshooting
Fix common issues
