This guide helps you integrate OpsLens into your existing systems and workflows.
OpsLens provides REST APIs and webhooks (coming soon) to integrate with:
- Monitoring tools (Datadog, Grafana, CloudWatch)
- Incident management (PagerDuty, Opsgenie)
- Version control (GitHub, GitLab)
- Communication (Slack, Microsoft Teams)
- Observability (OpenTelemetry, Jaeger)
- Set up OpsLens (see README.md)
- Configure API keys in
secrets.env - Test integrations (see below)
- Set up webhooks or polling
- Configure automated screenshot capture
- Train team on using OpsLens
http://localhost:8000/api/v1 # Development
https://your-domain.com/api/v1 # Production
Currently, OpsLens runs in development mode without authentication. For production:
- Add API key authentication
- Implement OAuth2
- Use JWT tokens
POST /api/v1/incidents
Content-Type: application/json
{
"title": "High error rate in payment service",
"description": "Error rate increased to 5%",
"severity": "high"
}POST /api/v1/evidence/incident/{incident_id}/upload-screenshot
Content-Type: multipart/form-data
file: <screenshot.png>The VLM will automatically analyze the screenshot and add insights to the evidence.
POST /api/v1/evidence/incident/{incident_id}
Content-Type: application/json
{
"evidence_type": "log",
"title": "Application logs",
"content": "Error logs from payment service...",
"source": "datadog"
}Current: OpsLens fetches incidents from PagerDuty API
Future: Webhook integration
# PagerDuty webhook → OpsLens
# Automatically create incidents when PagerDuty alerts fireCurrent: OpsLens fetches recent PR merges
Future: Webhook integration
# GitHub webhook → OpsLens
# Automatically add deployment events to incidentsPattern: Automated screenshot capture + upload
# Example: Datadog screenshot capture
import requests
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1 import DashboardsApi
# Capture dashboard screenshot
screenshot = capture_dashboard_screenshot(dashboard_id)
# Upload to OpsLens
incident_id = create_incident("High CPU alert")
upload_screenshot(incident_id, screenshot)Pattern: Incident updates via Slack
# OpsLens → Slack webhook
# Post incident updates, hypotheses, actions to Slack channel-
Dashboard Analysis
- Capture Grafana/Datadog dashboards on alerts
- Upload to OpsLens for AI analysis
- Get insights without manual review
-
Error Screenshot Analysis
- Capture application error screens
- VLM identifies error types and patterns
- Correlate with logs and metrics
-
Deployment Verification
- Capture deployment dashboards
- Verify metrics after deployment
- Detect anomalies automatically
import requests
from PIL import Image
import io
def analyze_dashboard_screenshot(dashboard_url, incident_id):
# Capture screenshot (using selenium, playwright, etc.)
screenshot = capture_screenshot(dashboard_url)
# Upload to OpsLens
response = requests.post(
f"http://localhost:8000/api/v1/evidence/incident/{incident_id}/upload-screenshot",
files={"file": ("screenshot.png", screenshot, "image/png")}
)
evidence_id = response.json()["id"]
# Poll for VLM analysis
while True:
evidence = requests.get(
f"http://localhost:8000/api/v1/evidence/{evidence_id}"
).json()
if evidence.get("content"):
analysis = evidence["content"]
print(f"VLM Analysis: {analysis}")
return analysis
time.sleep(2)OpsLens will accept webhooks from:
- PagerDuty (incident creation/updates)
- GitHub (PR merges, deployments)
- Slack (incident threads)
- Monitoring tools (alerts, metrics)
OpsLens will send webhooks to:
- Slack (incident updates)
- Teams (notifications)
- Custom endpoints (your systems)
-
Automate Everything
- Set up automated screenshot capture
- Use webhooks instead of polling
- Integrate with CI/CD pipelines
-
Error Handling
- Implement retries for API calls
- Handle rate limits gracefully
- Log all integration errors
-
Security
- Use API keys for authentication
- Validate webhook signatures
- Encrypt sensitive data
-
Monitoring
- Monitor integration health
- Track API usage
- Alert on integration failures
-
Test VLM:
curl http://localhost:8000/api/v1/test/vlm/status
-
Test Integrations:
curl http://localhost:8000/api/v1/integrations/test/all
-
Test API:
# Create test incident curl -X POST http://localhost:8000/api/v1/incidents \ -H "Content-Type: application/json" \ -d '{"title": "Test Incident", "severity": "low"}'
For integration help:
- Check API documentation: http://localhost:8000/docs
- Review test endpoints
- Open an issue on GitHub
- Check integration logs:
docker-compose logs backend
- Set up your first integration
- Test with real data
- Automate screenshot capture
- Configure webhooks (when available)
- Train your team