Skip to content

[AutoOps] Restructure error type #48653

@pickypg

Description

@pickypg

We should restructure the error object that we ship from the autoops_es module so that the errors can be more easily used.

Specifically, we currently nest a custom error object under whatever metricset resulted in the error and we use ECS-formatted field names within the error object. We should take those fields and put them at the root.

It would be nice to have errors look more like this:

{
  "@timestamp": "2026-02-03T02:31:00.183Z",
  "@metadata": {
    "beat": "metricbeat",
    "type": "_doc",
    "version": "9.4.0"
  },
  "agent": {
    "id": "fe280bcd-e74a-4ee1-ac5a-eeda0553e0cb",
    "name": "my-host",
    "type": "metricbeat",
    "version": "9.4.0",
    "ephemeral_id": "134a30da-09a5-49dc-bef6-071a6cf35f39"
  },
  "ecs": {
    "version": "8.0.0"
  },
  "url": {
    "path": "/",
    "query": ""
  },
  "service": {
    "address": "http://mycluster:1234",
    "type": "autoops_es"
  },
  "autoops_es": {
    "transaction_id": "019c2156-c35d-73bf-8d0d-b127bcbf344a",
    "cluster": {
      "id": "",
      "name": "",
      "version": ""
    }
  },
  "event": {
    "kind": "metric",
    "dataset": "autoops_es.node_stats",
    "module": "autoops_es",
    "duration": 6192875,
    "type": "error"
  },
  "http": {
    "request": {
      "method": "GET"
    },
    "response": {
      "status_code": 0
    }
  },
  "metricset": {
    "name": "node_stats",
    "period": 10000
  },
  "error": {
    "code": "HTTP_0",
    "message": "failed to send request: error making http request: Get \"http://mycluster:1234/\": lookup es-customer: no such host"
  },
  "orchestrator": {
    "resource": {
      "id": "abc123"
    }
  },
  "host": {
    "name": "my-host"
  }
}

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions