{
  "type": "record",
  "Aspect": {
    "name": "incidentActivityEvent",
    "type": "timeseries"
  },
  "name": "IncidentActivityEvent",
  "namespace": "com.linkedin.pegasus2avro.incident",
  "fields": [
    {
      "type": "long",
      "name": "timestampMillis",
      "doc": "The event timestamp field as epoch at UTC in milli seconds."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "TimeWindowSize",
          "namespace": "com.linkedin.pegasus2avro.timeseries",
          "fields": [
            {
              "type": {
                "type": "enum",
                "name": "CalendarInterval",
                "namespace": "com.linkedin.pegasus2avro.timeseries",
                "symbols": [
                  "SECOND",
                  "MINUTE",
                  "HOUR",
                  "DAY",
                  "WEEK",
                  "MONTH",
                  "QUARTER",
                  "YEAR"
                ]
              },
              "name": "unit",
              "doc": "Interval unit such as minute/hour/day etc."
            },
            {
              "type": "int",
              "name": "multiple",
              "default": 1,
              "doc": "How many units. Defaults to 1."
            }
          ],
          "doc": "Defines the size of a time window."
        }
      ],
      "name": "eventGranularity",
      "default": null,
      "doc": "Granularity of the event if applicable"
    },
    {
      "type": [
        {
          "type": "record",
          "name": "PartitionSpec",
          "namespace": "com.linkedin.pegasus2avro.timeseries",
          "fields": [
            {
              "type": {
                "type": "enum",
                "name": "PartitionType",
                "namespace": "com.linkedin.pegasus2avro.timeseries",
                "symbols": [
                  "FULL_TABLE",
                  "QUERY",
                  "PARTITION"
                ]
              },
              "name": "type",
              "default": "PARTITION"
            },
            {
              "TimeseriesField": {},
              "type": "string",
              "name": "partition",
              "doc": "String representation of the partition"
            },
            {
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "TimeWindow",
                  "namespace": "com.linkedin.pegasus2avro.timeseries",
                  "fields": [
                    {
                      "type": "long",
                      "name": "startTimeMillis",
                      "doc": "Start time as epoch at UTC."
                    },
                    {
                      "type": "com.linkedin.pegasus2avro.timeseries.TimeWindowSize",
                      "name": "length",
                      "doc": "The length of the window."
                    }
                  ]
                }
              ],
              "name": "timePartition",
              "default": null,
              "doc": "Time window of the partition if applicable"
            }
          ],
          "doc": "Defines how the data is partitioned"
        },
        "null"
      ],
      "name": "partitionSpec",
      "default": {
        "partition": "FULL_TABLE_SNAPSHOT",
        "type": "FULL_TABLE",
        "timePartition": null
      },
      "doc": "The optional partition specification."
    },
    {
      "type": [
        "null",
        "string"
      ],
      "name": "messageId",
      "default": null,
      "doc": "The optional messageId, if provided serves as a custom user-defined unique identifier for an aspect value."
    },
    {
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "IncidentActivityChange",
          "namespace": "com.linkedin.pegasus2avro.incident",
          "fields": [
            {
              "TimeseriesCollection": {},
              "type": {
                "type": "enum",
                "symbolDocs": {
                  "ASSIGNEES": "Assignees were added or removed",
                  "PRIORITY": "The priority of the incident changed",
                  "STAGE": "Lifecycle stage of the incident changes",
                  "STATE": "State of the incident changed"
                },
                "name": "IncidentActivityChangeType",
                "namespace": "com.linkedin.pegasus2avro.incident",
                "symbols": [
                  "ASSIGNEES",
                  "STATE",
                  "STAGE",
                  "PRIORITY"
                ]
              },
              "name": "type",
              "doc": "The type of change. TODO: Determine if description change should be included in this aspect.\nThis is a timeseries field so you can filter by a given change type!"
            }
          ],
          "doc": "Incident Activity Change is a record that represents the changes that occurred in the incident activity event."
        }
      },
      "name": "changes",
      "default": [],
      "doc": "The actual changes that occurred in the incident activity event."
    },
    {
      "Relationship": {
        "/entities/*": null
      },
      "Searchable": {
        "/assignees/*/actor": null,
        "/created/time": null,
        "/customType": null,
        "/description": null,
        "/entities/*": null,
        "/priority": null,
        "/source/sourceUrn": null,
        "/source/type": null,
        "/startedAt": null,
        "/status/lastUpdated/time": null,
        "/status/stage": null,
        "/status/state": null,
        "/title": null,
        "/type": null
      },
      "type": {
        "type": "record",
        "Aspect": {
          "name": "incidentInfo"
        },
        "name": "IncidentInfo",
        "namespace": "com.linkedin.pegasus2avro.incident",
        "fields": [
          {
            "Searchable": {
              "addToFilters": true,
              "filterNameOverride": "Type"
            },
            "type": {
              "type": "enum",
              "symbolDocs": {
                "CUSTOM": "A custom type of incident",
                "DATASET_COLUMN": "An assertion on a particular column(s) of a Dataset has triggered the incident.\nRaised on Datasets where assertions are configured to generate incidents.\nDeprecated! Use FIELD instead. Will be removed.",
                "DATASET_ROWS": "An assertion on the row count of a Dataset has triggered the incident.\nRaised on datasets where assertions are configured to generate incidents.\nDeprecated! Use VOLUME instead. Will be removed.",
                "DATA_SCHEMA": "A Data Schema assertion has failed, triggering the incident.\nRaised on entities where assertions are configured to generate incidents.",
                "FIELD": "A Field Assertion has failed, triggering the incident.\nRaised on entities where assertions are configured to generate incidents.",
                "FRESHNESS": "An Freshness Assertion has failed, triggering the incident.\nRaised on entities where assertions are configured to generate incidents.",
                "OPERATIONAL": "A misc. operational incident, e.g. failure to materialize a dataset.",
                "SQL": "A raw SQL-statement based assertion has failed, triggering the incident.\nRaised on entities where assertions are configured to generate incidents.",
                "VOLUME": "An Volume Assertion has failed, triggering the incident.\nRaised on entities where assertions are configured to generate incidents."
              },
              "deprecatedSymbols": {
                "DATASET_COLUMN": true,
                "DATASET_ROWS": true
              },
              "name": "IncidentType",
              "namespace": "com.linkedin.pegasus2avro.incident",
              "symbols": [
                "FRESHNESS",
                "VOLUME",
                "FIELD",
                "SQL",
                "DATA_SCHEMA",
                "OPERATIONAL",
                "CUSTOM",
                "DATASET_COLUMN",
                "DATASET_ROWS"
              ],
              "doc": "A type of asset incident"
            },
            "name": "type",
            "doc": "The type of incident"
          },
          {
            "Searchable": {
              "addToFilters": true,
              "filterNameOverride": "Other Type"
            },
            "type": [
              "null",
              "string"
            ],
            "name": "customType",
            "default": null,
            "doc": "An optional custom incident type. Present only if type is 'CUSTOM'."
          },
          {
            "Searchable": {
              "boostScore": 10.0,
              "fieldType": "WORD_GRAM"
            },
            "type": [
              "null",
              "string"
            ],
            "name": "title",
            "default": null,
            "doc": "Optional title associated with the incident"
          },
          {
            "Searchable": {
              "fieldType": "TEXT"
            },
            "type": [
              "null",
              "string"
            ],
            "name": "description",
            "default": null,
            "doc": "Optional description associated with the incident"
          },
          {
            "Relationship": {
              "/*": {
                "entityTypes": [
                  "dataset",
                  "chart",
                  "dashboard",
                  "dataFlow",
                  "dataJob",
                  "schemaField"
                ],
                "name": "IncidentOn"
              }
            },
            "Searchable": {
              "/*": {
                "fieldType": "URN"
              }
            },
            "type": {
              "type": "array",
              "items": "string"
            },
            "name": "entities",
            "doc": "A reference to the entity associated with the incident.",
            "Urn": "Urn",
            "urn_is_array": true
          },
          {
            "Searchable": {
              "addToFilters": true,
              "filterNameOverride": "Priority"
            },
            "type": [
              "int",
              "null"
            ],
            "name": "priority",
            "default": 0,
            "doc": "A numeric severity or priority for the incident. On the UI we will translate this into something easy to understand.\nCurrently supported: 0 - CRITICAL, 1 - HIGH, 2 - MED, 3 - LOW\n(We probably should have modeled as an enum)"
          },
          {
            "type": [
              "null",
              {
                "type": "array",
                "items": {
                  "type": "record",
                  "name": "IncidentAssignee",
                  "namespace": "com.linkedin.pegasus2avro.incident",
                  "fields": [
                    {
                      "Searchable": {
                        "addToFilters": true,
                        "fieldName": "assignees",
                        "filterNameOverride": "Assignee"
                      },
                      "java": {
                        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                      },
                      "type": "string",
                      "name": "actor",
                      "doc": "The user or group assigned to the incident.",
                      "Urn": "Urn"
                    },
                    {
                      "type": {
                        "type": "record",
                        "name": "AuditStamp",
                        "namespace": "com.linkedin.pegasus2avro.common",
                        "fields": [
                          {
                            "type": "long",
                            "name": "time",
                            "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
                          },
                          {
                            "java": {
                              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                            },
                            "type": "string",
                            "name": "actor",
                            "doc": "The entity (e.g. a member URN) which will be credited for moving the resource/association/sub-resource into the specific lifecycle stage. It is also the one used to authorize the change.",
                            "Urn": "Urn"
                          },
                          {
                            "java": {
                              "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                            },
                            "type": [
                              "null",
                              "string"
                            ],
                            "name": "impersonator",
                            "default": null,
                            "doc": "The entity (e.g. a service URN) which performs the change on behalf of the Actor and must be authorized to act as the Actor.",
                            "Urn": "Urn"
                          },
                          {
                            "type": [
                              "null",
                              "string"
                            ],
                            "name": "message",
                            "default": null,
                            "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
                          }
                        ],
                        "doc": "Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage."
                      },
                      "name": "assignedAt",
                      "doc": "The time & actor responsible for assiging the assignee."
                    }
                  ],
                  "doc": "The incident assignee type.\nThis is in a record so that we can add additional fields if we need to later (e.g.\nthe type of the assignee."
                }
              }
            ],
            "name": "assignees",
            "default": null,
            "doc": "The parties assigned with resolving the incident"
          },
          {
            "type": {
              "type": "record",
              "name": "IncidentStatus",
              "namespace": "com.linkedin.pegasus2avro.incident",
              "fields": [
                {
                  "Searchable": {
                    "addToFilters": true,
                    "filterNameOverride": "Status"
                  },
                  "type": {
                    "type": "enum",
                    "symbolDocs": {
                      "ACTIVE": "The incident is ongoing, or active.",
                      "RESOLVED": "The incident is resolved."
                    },
                    "name": "IncidentState",
                    "namespace": "com.linkedin.pegasus2avro.incident",
                    "symbols": [
                      "ACTIVE",
                      "RESOLVED"
                    ]
                  },
                  "name": "state",
                  "doc": "The top-level state of the incident, whether it's active or resolved."
                },
                {
                  "Searchable": {
                    "addToFilters": true,
                    "filterNameOverride": "Stage"
                  },
                  "type": [
                    "null",
                    {
                      "type": "enum",
                      "symbolDocs": {
                        "FIXED": "The incident is in the resolved as completed stage.",
                        "INVESTIGATION": "The incident root cause is being investigated.",
                        "NO_ACTION_REQUIRED": "The incident is in the resolved with no action required state, e.g. the\nincident was a false positive, or was expected.",
                        "TRIAGE": "The impact and priority of the incident is being actively assessed.",
                        "WORK_IN_PROGRESS": "The incident is in the remediation stage."
                      },
                      "name": "IncidentStage",
                      "namespace": "com.linkedin.pegasus2avro.incident",
                      "symbols": [
                        "TRIAGE",
                        "INVESTIGATION",
                        "WORK_IN_PROGRESS",
                        "FIXED",
                        "NO_ACTION_REQUIRED"
                      ]
                    }
                  ],
                  "name": "stage",
                  "default": null,
                  "doc": "The lifecycle stage for the incident - Null means no stage was assigned yet.\nIn the future, we may add CUSTOM here with a customStage string field for user-defined stages."
                },
                {
                  "type": [
                    "null",
                    "string"
                  ],
                  "name": "message",
                  "default": null,
                  "doc": "Optional message associated with the incident"
                },
                {
                  "Searchable": {
                    "/time": {
                      "fieldName": "lastUpdated",
                      "fieldType": "COUNT"
                    }
                  },
                  "type": "com.linkedin.pegasus2avro.common.AuditStamp",
                  "name": "lastUpdated",
                  "doc": "The time at which the request was initially created"
                }
              ],
              "doc": "Information about an incident raised on an asset"
            },
            "name": "status",
            "doc": "The current status of an incident, i.e. active or inactive."
          },
          {
            "type": [
              "null",
              {
                "type": "record",
                "Aspect": {
                  "name": "incidentSource"
                },
                "name": "IncidentSource",
                "namespace": "com.linkedin.pegasus2avro.incident",
                "fields": [
                  {
                    "Searchable": {
                      "addToFilters": true,
                      "filterNameOverride": "Source"
                    },
                    "type": {
                      "type": "enum",
                      "symbolDocs": {
                        "ASSERTION_FAILURE": "An assertion has failed, triggering the incident.",
                        "MANUAL": "Manually created incident, via UI or API."
                      },
                      "name": "IncidentSourceType",
                      "namespace": "com.linkedin.pegasus2avro.incident",
                      "symbols": [
                        "MANUAL",
                        "ASSERTION_FAILURE"
                      ]
                    },
                    "name": "type",
                    "doc": "Message associated with the incident"
                  },
                  {
                    "Searchable": {
                      "fieldType": "URN"
                    },
                    "java": {
                      "class": "com.linkedin.pegasus2avro.common.urn.Urn"
                    },
                    "type": [
                      "null",
                      "string"
                    ],
                    "name": "sourceUrn",
                    "default": null,
                    "doc": "Reference to an URN related to the source of an incident. Currently populated when the type of the incident\nis ASSERTION_FAILURE.\n\nIf this incident was raised due to an assertion failure, then this will contain the urn of the source Assertion.",
                    "Urn": "Urn"
                  }
                ],
                "doc": "Information about the source of an incident raised on an asset."
              }
            ],
            "name": "source",
            "default": null,
            "doc": "The source of an incident, i.e. how it was generated."
          },
          {
            "Searchable": {
              "fieldType": "COUNT"
            },
            "type": [
              "null",
              "long"
            ],
            "name": "startedAt",
            "default": null,
            "doc": "The time at which the incident actually started (may be before the date it was raised)."
          },
          {
            "Searchable": {
              "/time": {
                "fieldName": "created",
                "fieldType": "COUNT"
              }
            },
            "type": "com.linkedin.pegasus2avro.common.AuditStamp",
            "name": "created",
            "doc": "The time at which the request was initially created"
          }
        ],
        "doc": "Information about an incident raised on an asset.\n\nNOTE: When this file is changed, update IncidentActivityEvent.pdl to remove searchable and relationship annotations."
      },
      "name": "previousInfo",
      "doc": "The raw previous incident info. Removed all annotations."
    },
    {
      "Relationship": {
        "/entities/*": null
      },
      "Searchable": {
        "/assignees/*/actor": null,
        "/created/time": null,
        "/customType": null,
        "/description": null,
        "/entities/*": null,
        "/priority": null,
        "/source/sourceUrn": null,
        "/source/type": null,
        "/startedAt": null,
        "/status/lastUpdated/time": null,
        "/status/stage": null,
        "/status/state": null,
        "/title": null,
        "/type": null
      },
      "type": "com.linkedin.pegasus2avro.incident.IncidentInfo",
      "name": "newInfo",
      "doc": "The raw new incident info. Removed all annotations."
    },
    {
      "TimeseriesField": {},
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      },
      "type": "string",
      "name": "actorUrn",
      "doc": "The actor who performed the activity.",
      "Urn": "Urn"
    }
  ],
  "doc": "A lifecycle event for an incident lifecycle change event\nthat should be visible in the incident activity log."
}