Repository navigation
Description
Summary
Add AutoOps insights to the Elastic CLI so users can search and fetch insights for Elastic Cloud deployments, Serverless projects (including VectorDB), and connected clusters.
Read-only. The CLI consumes insights; it does not create or mutate them.
Spec (source of truth)
Elastic Cloud Monitoring API, OpenAPI 3.0.3 (info.version 1.0.0).
- Host:
https://api.elastic-cloud.com(server URLhttps://api.elastic-cloud.com/api). - Auth: Elastic Cloud API key already in the CLI Cloud context. Header
Authorization: ApiKey <key>— notBearer/ JWT. - No
regionquery parameter. The Cloud gateway resolves region. Do not add--regionon these commands. - Catalog: rule IDs and tags at https://ela.st/autoops-insights.json
Do not implement against the original issue text, or any spec that still has _all, region, include_context, or Bearer auth.
Resource scope
Path: /v1/monitoring/{resourceType}/{resourceId}/insights/...
| Path param | Values |
|---|---|
resourceType |
deployments | projects | clusters |
resourceId |
Concrete deployment ID, Serverless project ID (Elasticsearch, Observability, Security, VectorDB), or connected-cluster ID |
Do not send _all. There is no org-wide insights path. Fleet-wide views: list resources with existing Cloud CLI commands, then call search once per resource and aggregate client-side. VectorDB projects still use resourceType=projects.
Access is checked for that single resource on every request.
Endpoints
1. Search — POST /api/v1/monitoring/{resourceType}/{resourceId}/insights/_search
Returns insights that were open (active) at any point in the window and match all set criteria (AND across fields, OR within a list). Disabled rules for the resource are never returned.
Defaults when the body is omitted: from = 24h ago, to = now, order = desc, size = 1000, include_closed = false.
| Body field | Type | Default | Notes |
|---|---|---|---|
from / to |
ISO 8601 with Z/offset, or UNIX epoch ms |
24h ago / now | Inclusive. to must not be earlier than from. Currently open insights still match even if they started before from. |
order |
asc | desc |
desc |
Sort by event.start. Case-sensitive. |
size |
int ≥ 1 | 1000 |
Hard-capped at 5000. |
cursor |
opaque string | — | Next page. When set, original criteria and order are reused; all other fields except size are validated but ignored. Pass back exactly; do not parse or mint. |
rules |
string[] | — | rule.id (lowercase underscores). Case-insensitive. Unknown ID → 400. Catalog: ela.st. |
severities |
enum[] | — | critical | high | medium | low | info (lowercase, case-sensitive). Matches severity when raised, which can differ from current autoops.severity. |
include_closed |
bool | false |
Include closed insights that overlapped the window. |
actionable_only |
bool | false |
Only insights with ≥ 1 recommended action. |
tags |
string[] | — | Whole-tag match, case-insensitive. Namespaced, e.g. domain:performance, scope:node. Catalog: ela.st. |
modified_only |
bool | false |
Match from/to against event.updated instead of start/end. |
Pagination: When return_count equals the page size (size capped at 5000), the response includes cursor. A full page always carries a cursor, even when nothing remains — the next page can be empty. Stop when insights is empty or return_count < page size. Do not loop only because cursor is present.
Product note (not in OpenAPI): closed insights are retained ~10 days; open insights persist. A window older than that will not return closed events that have aged out.
2. Get by ID — GET /api/v1/monitoring/{resourceType}/{resourceId}/insights/{insightId}
insightId is event.id (UUID). No include_context query param.
Insight shape
ECS-aligned event + custom autoops. Omitted, not null, when a property has no value. Required: @timestamp, event, service, elasticsearch, observer, rule, message, autoops.
| Location | Role |
|---|---|
@timestamp |
When raised (ISO 8601 UTC) |
event.id / .start / .url |
Public UUID, sort key, get-by-id URL |
event.end / .duration |
Closed only. Duration is nanoseconds (end − start). Omitted while open. |
event.updated |
Last AutoOps update (start when raised, end when closed) |
rule.id / .name / .description |
Type key (lowercase underscores), label, impact. Description may include markup. |
message |
Evidence (may include markup) |
autoops.title / .severity / .actions[] |
Headline, critical…info, ordered actions |
autoops.actions[] |
type, title, description (HTML allowed, may be empty), command omitted when none |
elasticsearch.cluster.id / .name |
ES cluster |
elasticsearch.node.name[] / .id[] / .tier |
Always arrays for name/id |
elasticsearch.index.name[] |
Always an array |
service.type |
Always elasticsearch |
service.id / .name |
Resource id; name may be empty |
observer.name |
Always autoops |
organization.id |
Owning org |
tags |
Namespaced strings |
There is no autoops.context / include_context. Use elasticsearch.* for nodes/indices.
Errors
| Status | Body |
|---|---|
400 |
ErrorResponse — bad body, unknown enum/rule id, bad date, size < 1, invalid cursor, to < from |
401 |
Missing/invalid/expired Cloud API key, or org has no AutoOps account |
403 |
Not authorized for that resource, or unsupported resourceType |
404 |
No such resource for the caller’s org, wrong resourceType, or unknown insightId |
429 |
Org rate limit — RateLimitErrorResponse { status, code, message }, not ErrorResponse. No Retry-After. Wait a few seconds and retry. |
500 |
ErrorResponse; body may be empty when AutoOps is temporarily unavailable |
ErrorResponse: { ok: false, error: { type, details? } }. details is diagnostic only, not a stable contract.
UX / command structure
Command group: elastic cloud monitoring (matches the Elastic Cloud Monitoring API and /v1/monitoring/...). Flag mapping should follow the request body 1:1 (--from, --to, --order, --size, --cursor, --rules, --severities, --include-closed, --actionable-only, --tags, --modified-only). Required: --resource-type and --resource-id. Get-by-id additionally --insight-id.
elastic cloud monitoring insights search --resource-type deployments --resource-id <id> …
elastic cloud monitoring insights get --resource-type deployments --resource-id <id> --insight-id <uuid>
Print autoops.actions[].command when present. Paginate until empty page / short page. For “all my deployments”, loop existing list commands — never _all.
Out of scope
- Mutating insights
What changed vs the original issue
Dropped: resourceId=_all, region, include_context / autoops.context, Bearer JWT, severities without critical/info, un-namespaced tags. Added: modified_only, ApiKey, 429 envelope, omit-not-null, required elasticsearch with node/index arrays, size cap 5000, cursor empty-next-page rule, VectorDB as projects.
Activity
ori-shafir commentedon Sep 22, 2026
@JoshMock is there a planned ETA for this ?
consulthys commentedon Nov 13, 2026
consulthys commentedon Nov 13, 2026
JoshMock commentedon Nov 13, 2026
Updated the body. 👍 This is still on our backlog, but work is temporarily paused while our team gets 9.6 ES clients ready for next week's stack release.
consulthys commentedon Nov 24, 2026
The Elastic Cloud Monitoring API is now published. Please fold this into the Spec (source of truth) header (I cannot edit the issue):
.jsonsuffix; insight rule ids)Endpoints, auth (
ApiKey), host, and path shape in this issue are unchanged. The/docs/api/doc/cloud-monitoringpath still redirects; the canonical URL dropped/doc/.