{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "insights/v1/events/honeybadger-elixir/oban.job.exception.json",
  "title": "Oban: job exception",
  "description": "An Oban job raised an exception or exited. Uses the same fields as oban.job.stop.",
  "x-hb": {
    "notifiers": [
      "honeybadger-elixir"
    ],
    "category": "jobs",
    "component": "Oban"
  },
  "type": "object",
  "properties": {
    "event_type": {
      "type": "string",
      "const": "oban.job.exception"
    },
    "id": {
      "type": "integer",
      "description": "Oban job database ID.",
      "examples": [
        123457
      ]
    },
    "worker": {
      "type": "string",
      "description": "Worker module name.",
      "examples": [
        "MyApp.Workers.WelcomeEmail"
      ]
    },
    "queue": {
      "type": "string",
      "description": "Queue the job ran on.",
      "examples": [
        "default"
      ]
    },
    "state": {
      "type": "string",
      "description": "Final job state, e.g. \"failure\", \"discard\".",
      "examples": [
        "failure"
      ]
    },
    "attempt": {
      "type": "integer",
      "description": "Attempt number (1-based).",
      "examples": [
        2
      ]
    },
    "prefix": {
      "type": "string",
      "description": "Oban database prefix (schema).",
      "examples": [
        "public"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tags assigned to the job.",
      "examples": [
        [
          "mailer"
        ]
      ]
    },
    "args": {
      "type": "object",
      "description": "Job arguments map.",
      "additionalProperties": true,
      "examples": [
        {
          "user_id": 42
        }
      ]
    },
    "duration": {
      "type": "number",
      "description": "Job execution duration in microseconds.",
      "examples": [
        125000
      ]
    },
    "request_id": {
      "type": "string",
      "description": "Request ID propagated from the originating request or generated for background jobs.",
      "examples": [
        "f2a9c81d4e6b3a7f0c5d9e2b8a4f6c1d"
      ]
    }
  },
  "required": [
    "event_type",
    "worker",
    "queue"
  ]
}
