{
  "type": "record",
  "Aspect": {
    "name": "metricInfo"
  },
  "name": "MetricInfo",
  "namespace": "com.linkedin.pegasus2avro.metric",
  "fields": [
    {
      "Searchable": {
        "boostScore": 10.0,
        "enableAutocomplete": true,
        "fieldNameAliases": [
          "_entityName"
        ],
        "fieldType": "WORD_GRAM",
        "searchLabel": "entityName",
        "searchTier": 1
      },
      "type": "string",
      "name": "name",
      "doc": "Display name of the metric."
    },
    {
      "Searchable": {
        "fieldType": "TEXT",
        "hasValuesFieldName": "hasDescription",
        "searchTier": 2
      },
      "type": [
        "null",
        "string"
      ],
      "name": "description",
      "default": null,
      "doc": "Human-readable description of the metric."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "createdAt",
          "fieldType": "DATETIME",
          "searchLabel": "createdAt"
        }
      },
      "type": [
        "null",
        {
          "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": "created",
      "default": null,
      "doc": "Audit stamp capturing when this metric was created and by whom\n(as reported by the source platform / ingestor)."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "lastModifiedAt",
          "fieldType": "DATETIME",
          "searchLabel": "lastModifiedAt"
        }
      },
      "type": [
        "null",
        "com.linkedin.pegasus2avro.common.AuditStamp"
      ],
      "name": "lastModified",
      "default": null,
      "doc": "Audit stamp capturing when this metric was last modified and by whom.\nEquals `created` when no modification has occurred since ingestion."
    },
    {
      "Relationship": {
        "entityTypes": [
          "semanticModel"
        ],
        "name": "ModeledBy"
      },
      "Searchable": {
        "fieldName": "semanticModel",
        "fieldType": "URN",
        "hasValuesFieldName": "hasSemanticModel"
      },
      "java": {
        "class": "com.linkedin.pegasus2avro.common.urn.Urn"
      },
      "type": [
        "null",
        "string"
      ],
      "name": "semanticModel",
      "default": null,
      "doc": "The semantic model that defines this metric.",
      "Urn": "Urn",
      "entityTypes": [
        "semanticModel"
      ]
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "MetricExpression",
          "namespace": "com.linkedin.pegasus2avro.metric",
          "fields": [
            {
              "type": {
                "type": "array",
                "items": {
                  "type": "record",
                  "name": "DialectExpression",
                  "namespace": "com.linkedin.pegasus2avro.metric",
                  "fields": [
                    {
                      "type": {
                        "type": "enum",
                        "symbolDocs": {
                          "ANSI_SQL": " Standard SQL dialect. ",
                          "DATABRICKS": " Databricks SQL. ",
                          "MAQL": " GoodData MAQL (Metric Analysis and Query Language). ",
                          "MDX": " Multi-Dimensional Expressions (OLAP cubes). ",
                          "OTHER": "A dialect not yet represented as a named symbol.",
                          "SNOWFLAKE": " Snowflake SQL. ",
                          "TABLEAU": " Tableau calculations. "
                        },
                        "name": "Dialect",
                        "namespace": "com.linkedin.pegasus2avro.metric",
                        "symbols": [
                          "ANSI_SQL",
                          "SNOWFLAKE",
                          "MDX",
                          "TABLEAU",
                          "DATABRICKS",
                          "MAQL",
                          "OTHER"
                        ],
                        "doc": "The SQL or expression-language dialect that produced a metric expression.\nValue set is aligned 1:1 with the OSI (Open Semantic Interchange) spec."
                      },
                      "name": "dialect",
                      "doc": "The dialect in which this expression is written."
                    },
                    {
                      "type": "string",
                      "name": "expression",
                      "doc": "The raw expression string."
                    }
                  ],
                  "doc": "A metric expression in a specific SQL dialect or semantic layer language."
                }
              },
              "name": "dialects",
              "doc": "The expression in one or more dialects."
            }
          ],
          "doc": "A metric's logical expression represented across one or more SQL dialects"
        }
      ],
      "name": "expression",
      "default": null,
      "doc": "The SQL expression used to compute this metric, in one or more dialects."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "AiContext",
          "namespace": "com.linkedin.pegasus2avro.metric",
          "fields": [
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "string"
                }
              ],
              "name": "synonyms",
              "default": null,
              "doc": "Alternative names or abbreviations by which this metric is known."
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "instructions",
              "default": null,
              "doc": "Human-readable guidance for AI models on how to interpret this metric."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "string"
                }
              ],
              "name": "examples",
              "default": null,
              "doc": "Example values or usage patterns to ground AI reasoning."
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "customInstructions",
              "default": null,
              "doc": "Additional free-form instructions for AI model customisation."
            }
          ],
          "doc": "AI-specific context attached to a metric or field to improve disambiguation,\nretrieval, and generation quality (OSI ai_context shape)."
        }
      ],
      "name": "aiContext",
      "default": null,
      "doc": "AI-specific context for improved disambiguation and retrieval."
    }
  ],
  "doc": "Core information about a Metric entity."
}