Environments¶
SerOps supports multi-environment tracking to analyze dev, staging, and production separately.
Default Environments¶
| Environment | Badge | Default Patterns |
|---|---|---|
| Production | Green | main, master |
| Staging | Yellow | staging, release/* |
| Development | Blue | develop, dev, feature/* |
How Environment Detection Works¶
graph LR
A[Deployment] --> B[Check Branch]
B --> C{Match Pattern?}
C -->|main| D[Production]
C -->|staging| E[Staging]
C -->|feature/*| F[Development]
C -->|No match| G[Default: Production]
SerOps uses branch patterns to determine which environment a deployment belongs to.
Configuring Environments¶
Per-Project Settings¶
- Navigate to Projects
- Click the Edit (pencil) icon on a project
- Scroll to the Environments section
Toggle Environments¶
Enable/disable environments for each project:
- ✅ Production (always recommended)
- ⬜ Staging (optional)
- ⬜ Development (optional)
Edit Branch Patterns¶
Click the edit icon next to an environment:
Production: main, master, release/*
Staging: staging, develop, qa
Development: feature/*, fix/*, hotfix/*
Pattern syntax:
- Exact match: main
- Wildcard: feature/*
- Multiple: main, master, release/*
Custom Environments¶
Add environments beyond the defaults:
- Click + Add Environment
- Enter name (e.g.,
qa,uat,demo) - Set branch patterns
- Click Save
Examples¶
| Custom Env | Use Case | Patterns |
|---|---|---|
qa |
QA testing | qa/* |
uat |
User acceptance | uat, release-candidate/* |
demo |
Sales demos | demo |
canary |
Canary releases | canary/* |
Environment Filtering¶
The Environment picker at the top left of every page filters the whole app: Overview, Issues, Analyses, traces and the rest follow the same choice. Pick All environments or one of production, staging and dev (an environment set elsewhere, for example from a shared link, is listed too). Organisations with registered Kubernetes clusters also get a Cluster picker next to it.
On the Analyses page each analysis shows its environment as a badge.
Environment Isolation¶
Data is strictly isolated per environment:
| Data Type | Isolation |
|---|---|
| Batches | Created per-environment |
| Logs | Filtered by env tag in ES |
| Deployments | Tracked with env field |
| Issues | Linked to env-specific batch |
No Cross-Contamination
Production issues never mix with development logs.
Best Practices¶
Environment Setup
- Always enable Production - It's where real issues occur
- Use consistent naming - Same patterns across projects
- Add QA/UAT if needed - For complex release pipelines
- Review patterns regularly - As branching strategy evolves
Pattern Examples
API Reference¶
Update Project Environments¶
PATCH /api/projects/{project_id}/
{
"environments": [
{
"name": "production",
"display_name": "Production",
"branch_patterns": ["main", "master"],
"is_active": true
},
{
"name": "staging",
"display_name": "Staging",
"branch_patterns": ["staging"],
"is_active": true
}
]
}
Filter Batches by Environment¶
Related Pages¶
- Projects & Services — Configure environments per project
- Analyses — Batches are created per environment
- Issues — Issues are scoped to environments
- Projects & Services API — REST API reference