Ppchelko has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284986

Change subject: Create a general error event schema
......................................................................

Create a general error event schema

Bug: T133431
Change-Id: I70419785d6d514b3f4e47fdd2ffe9ab8c16c6507
---
A jsonschema/error/1.yaml
1 file changed, 108 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas 
refs/changes/86/284986/1

diff --git a/jsonschema/error/1.yaml b/jsonschema/error/1.yaml
new file mode 100644
index 0000000..b9d2a34
--- /dev/null
+++ b/jsonschema/error/1.yaml
@@ -0,0 +1,108 @@
+title: Error
+description: Represents an unrecoverable failure in event processing
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema_uri:
+        type: string
+        description: >
+          The URI identifying the jsonschema for this event. This may be just
+          a short uri containing only the name and revision at the end of the
+          URI path.  e.g. schema_name/12345 is acceptable. This field is not
+          required.
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event / resource
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  emitter_id:
+    type: string
+    description: identifies the entity where a fatal failure occured
+  original_event:
+    type: object
+    description: original event that caused a failure
+  level:
+    enum:
+      - trace
+      - debug
+      - info
+      - warn
+      - error
+      - fatal
+    description: error severity level
+  message:
+    type: string
+    description: message describing an error
+  stack:
+    type: string
+    description: stack trace of the error (optional)
+  http_request:
+    type: object
+    description: http service request that caused an error (optional)
+    properties:
+      method:
+        type: string
+        description: request method
+      uri:
+        type: string
+        format: uri
+        desctiption: requested URI
+      headers:
+        type: object
+        description: request headers
+      body:
+        type: object
+        description: request body
+    required:
+      - method
+      - uri
+  http_response:
+    type: object
+    description: http service response that caused an error (optional)
+    properties:
+      status:
+        type: integer
+        description: http response status code
+      headers:
+        type: object
+        description: http response headers (optional)
+      body:
+        type: object
+        description: http response body
+    required:
+      - status
+      - body
+required:
+  - meta
+  - emitter_id
+  - original_event
+  - level
+  - message

-- 
To view, visit https://gerrit.wikimedia.org/r/284986
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70419785d6d514b3f4e47fdd2ffe9ab8c16c6507
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/event-schemas
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to