Prerequisites
- OpenSearch 1.x/2.x or Elasticsearch 7.x/8.x reachable from the machine running HealOps
- The cluster URL (e.g.
https://my-cluster.us-east-1.es.amazonaws.com) - Credentials for one of:
- HTTP Basic Auth (username and password) — typical for self-hosted OpenSearch
- API key — typical for Elastic Cloud
- No auth — only when the cluster has the security plugin disabled
Setup
Option 1: Interactive onboarding wizard
- OpenSearch URL — the base URL of your cluster
- Authentication method — choose one of:
- Username + Password (default) — for self-hosted OpenSearch with the security plugin enabled
- API key — for Elastic Cloud or clusters with API-key auth configured
- None (security disabled) — for clusters running with the security plugin disabled
GET /_cluster/health before saving, so you’ll see immediate feedback if the URL or credentials are wrong.
Option 2: Legacy CLI
Option 3: Environment variables
Add to your.env:
When both
OPENSEARCH_API_KEY and Basic Auth credentials are set, the API key takes precedence. If only one of OPENSEARCH_USERNAME / OPENSEARCH_PASSWORD is set, no Authorization header is emitted (the cluster will reject the request, surfacing the misconfiguration).
Option 4: Persistent store
Verify
How it works in investigations
When an OpenSearch integration is configured, HealOps automatically includes it as an evidence source during every investigation. Two tools become available to the investigation agent:query_elasticsearch_logs
Searches log indices for messages matching a Lucene/KQL query within a bounded time window. The agent uses this to:
- Pull error and exception messages around the alert timestamp
- Filter logs by service, container, or correlation ID extracted from alert annotations
- Surface stack traces and panic messages that explain a metric anomaly
- Cross-reference logs against alerts firing in Datadog, Grafana, or Alertmanager
error_logs slice pre-filtered for keywords like error, exception, traceback, and panic, so the agent can prioritize signal over noise.
query_opensearch_analytics
Runs bounded analytics queries against any index pattern (default *). The agent uses this for non-log data stored in OpenSearch — APM events, audit trails, business metrics, or any custom analytics index your team maintains.
Both tools share the same configured credentials, so configuring the integration once enables both query paths.
Troubleshooting
Security best practices
- Create a read-only OpenSearch user for HealOps — the agent only reads logs and analytics indices and never writes to the cluster during investigations.
- Limit the role to the indices HealOps needs (typically logs and APM indices), not cluster-wide.
- Store credentials in
.envor the integration store, not in source code. - For Elastic Cloud, generate a scoped API key and rotate it on a schedule rather than using the master deployment credentials.
- For self-hosted clusters behind a reverse proxy, prefer Basic Auth over disabling security entirely — even on internal networks.
Tracer