{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "insights/v1/events/honeybadger-ruby/error.occurred.karafka.json",
  "title": "Karafka: error.occurred",
  "description": "A Karafka consumer or the Karafka framework raised an error.",
  "x-hb": {
    "notifiers": [
      "honeybadger-ruby"
    ],
    "category": "jobs",
    "component": "Karafka"
  },
  "type": "object",
  "properties": {
    "event_type": {
      "type": "string",
      "const": "error.occurred.karafka"
    },
    "type": {
      "type": "string",
      "description": "Error source identifier, e.g., 'consumer.consume.error' or 'connection.error'.",
      "examples": [
        "consumer.consume.error"
      ]
    },
    "error": {
      "type": "string",
      "description": "Exception message and class name.",
      "examples": [
        "JSON::ParserError: unexpected token at 'invalid'"
      ]
    },
    "topic": {
      "type": "string",
      "description": "Kafka topic where the error occurred, if applicable.",
      "examples": [
        "orders"
      ]
    },
    "partition": {
      "type": "integer",
      "description": "Kafka partition where the error occurred, if applicable.",
      "examples": [
        0
      ]
    },
    "consumer_group": {
      "type": "string",
      "description": "Consumer group where the error occurred, if applicable.",
      "examples": [
        "orders_consumers"
      ]
    },
    "request_id": {
      "type": "string",
      "description": "Rails request UUID from the active web request context, if any. Merged globally by the Honeybadger agent.",
      "examples": [
        "3d9c2f81-6e5a-4f7b-9c0d-8a1b2c3d4e5f"
      ]
    },
    "hostname": {
      "type": "string",
      "description": "Server hostname. Attached to every event by default (events.attach_hostname).",
      "examples": [
        "worker-1.example.com"
      ]
    },
    "environment": {
      "type": "string",
      "description": "Application environment, e.g. \"production\". Attached to every event by default (events.attach_environment).",
      "examples": [
        "production"
      ]
    }
  },
  "required": [
    "event_type",
    "type",
    "error"
  ]
}
