title: fragment/analytics/legacy/eventcapsule description: > A wrapper around (legacy) EventLogging event schemas that encodes generic metadata. Legacy metawiki schema: https://meta.wikimedia.org/wiki/Schema:EventCapsule $id: /fragment/analytics/legacy/eventcapsule/1.1.0 $schema: 'https://json-schema.org/draft-07/schema#' type: object additionalProperties: false required: - $schema - meta properties: $schema: type: string description: > A URI identifying the JSONSchema for this event. This should match an schema's $id in a schema repository. E.g. /schema/title/1.0.0 meta: type: object required: - dt - stream properties: uri: type: string format: uri-reference maxLength: 8192 description: Unique URI identifying the event or entity request_id: type: string description: Unique ID of the request that caused the event id: type: string description: Unique ID of this event dt: type: string format: date-time maxLength: 128 description: 'UTC event datetime, in ISO-8601 format' domain: type: string description: Domain the event or entity pertains to minLength: 1 stream: type: string description: Name of the stream/queue/dataset that this event belongs in minLength: 1 http: type: object properties: method: type: string description: 'The HTTP request method (GET, POST, etc.)' status_code: description: The HTTP status code returned for this request (when known) type: integer minimum: -9007199254740991 maximum: 9007199254740991 client_ip: type: string description: The http client's IP address has_cookies: type: boolean description: True if the http request has any cookies set request_headers: type: object description: 'Request headers sent by the client. E.g. user-agent, etc.' additionalProperties: type: string response_headers: type: object description: Response headers sent back to the client (when known). additionalProperties: type: string client_dt: type: string format: date-time maxLength: 128 description: > ISO-8601 formatted timestamp of when the event occurred/was generated in UTC). This exists separately from meta.dt in the main common schema. For external client-sent instrumentation events, we want to allow meta.dt to be the received time (filled in by EventGate at ingest time), as we don't trust client-sent events to always set the proper date and time. Client-set event generation time should be set here instead. See: https://phabricator.wikimedia.org/T240460 wiki: type: string description: $wgDBName e.g. enwiki webHost: type: string description: >- Request host. 'window.location.hostname' on client-side events; $_SERVER['HTTP_HOST'] on server. schema: type: string description: Title of event schema. Deprecated. revision: description: Revision ID of event schema. Deprecated. type: integer minimum: -9007199254740991 maximum: 9007199254740991 topic: type: string description: The queue topic name this event belongs in. Deprecated. recvFrom: type: string description: Hostname of server emitting the log line. Deprecated. dt: type: string description: 'UTC ISO-8601 timestamp of event. Deprecated, use meta.dt.' format: date-time maxLength: 128 seqId: description: Udp2log sequence ID. Deprecated. type: integer minimum: -9007199254740991 maximum: 9007199254740991 uuid: type: string description: 'Unique event identifier. Deprecated, use meta.id.' maxLength: 128 ip: type: string description: > Client IP address that sent this event, usually best guess parsed out of from X-Client-IP header which is set by varnish from X-Forwarded-For. Deprecated, use http.client_ip.