Skip to main content

Metric

The metric entity represents a named, reusable business measurement defined in a semantic layer or metric store.

Identity

Metrics are identified by three fields:

  • platform — the DataPlatform URN that owns this metric (e.g. urn:li:dataPlatform:dbt, urn:li:dataPlatform:snowflake). Searchable as a URN field with autocomplete and a "Platform" filter pill.
  • path — the namespace path that scopes this metric within its platform, preventing name collisions when two teams define metrics with the same id on the same platform.
  • id — the metric name within that platform and path (e.g. total_revenue, daily_active_users).

An example URN: urn:li:metric:(urn:li:dataPlatform:dbt,analytics.orders_model,revenue).

Important Capabilities

Metric Info

Core metadata is stored in the metricInfo aspect:

  • name — human-readable display name; used for full-text search and autocomplete.
  • description — free-text description of what the metric measures.
  • created -- AuditStamp (time + actor) capturing when the metric was created and by whom. Search-indexed as createdAt (DATETIME).
  • lastModified -- AuditStamp capturing the most recent modification. Search-indexed as lastModifiedAt (DATETIME).
  • expression — the metric formula expressed in one or more SQL dialects. Each DialectExpression pairs a Dialect enum value with the raw SQL string.
  • aiContext — optional hints for AI/LLM consumers: synonyms, natural-language instructions, few-shot examples, and custom instructions.
  • semanticModel -- URN of the semanticModel entity that defines this metric's dimensional context. Optional: null when the metric was ingested without a semantic model context (e.g. thin catalog-only metrics from BI tools like Tableau) or is a native / SDK-authored metric awaiting a model. The ModeledBy relationship on this field carries isLineage: true, so when semanticModel is populated the metric automatically appears as a downstream node in the semantic model's lineage explorer — no additional lineage MCPs are needed.

Metric Relationships

Hierarchical and derivation relationships are stored in the metricRelationships aspect:

  • parentMetric -- URN of the parent metric. Used to build a hierarchical tree of metrics. Stored as an IsPartOf graph edge.
  • derivedFrom — array of DerivedMetricInput records pointing to source metrics. DerivedMetricInput includes Edge, so the payload is Edge-shaped (destinationUrn, audit stamps, properties bag). Edges are flagged isLineage: true so they appear in the DataHub lineage graph.
  • relatedMetrics — array of Edge records pointing to semantically related metrics (no lineage flag).

Governance and Lineage

The metric entity reuses these standard governance aspects: ownership, domains, globalTags, glossaryTerms, institutionalMemory, structuredProperties, status, deprecation, dataPlatformInstance, subTypes, documentation, browsePathsV2, applications.

Relationships with Other Entities

RelationshipDirectionTarget entityAspect / edge nameLineage?
ModeledByoutboundsemanticModelmetricInfoyes
IsPartOfoutboundmetricmetricRelationshipsno
DerivedFromoutboundmetricmetricRelationshipsyes
RelatedTooutboundmetricmetricRelationshipsno
Consumes (dataset)outbounddatasetmetricUpstreams.datasetUpstreamsyes
Consumes (schemaField)outboundschemaFieldmetricUpstreams.fieldUpstreamsyes

Metric-to-dataset and metric-to-column lineage are carried by the dedicated metricUpstreams aspect. datasetUpstreams and fieldUpstreams are independently optional so ingestion sources can populate whichever granularity they can extract. Metric-to-metric derivation lineage lives on metricRelationships.derivedFrom and is not folded into metricUpstreams.

Notable Exceptions

Environment-independent identity

Metrics encode platform (a DataPlatform URN) in the key but deliberately do NOT encode FabricType (unlike datasets, which include PROD/STAGING in their URN). Metrics are modeled as environment-independent business definitions: total_revenue in PROD and STAGING is the same concept, so both resolve to the same URN. Cross-platform metrics (e.g. the same measure in both dbt and Snowflake) remain as separate entities because platform is part of the URN.

Extensibility via structuredProperties

Entity-level extensibility uses the structuredProperties aspect, which is already registered for the metric entity. Structured properties support typed values, governance controls, search facets, and PATCH semantics — they are the recommended mechanism for platform-specific metadata such as additivity, filters, metricKind, and measureShape that does not yet warrant a first-class PDL field. These fields can be promoted to the core schema in a future revision when usage patterns across platforms become clear.

Technical Reference Guide

The sections above provide an overview of how to use this entity. The following sections provide detailed technical information about how metadata is stored and represented in DataHub.

Aspects are the individual pieces of metadata that can be attached to an entity. Each aspect contains specific information (like ownership, tags, or properties) and is stored as a separate record, allowing for flexible and incremental metadata updates.

Relationships show how this entity connects to other entities in the metadata graph. These connections are derived from the fields within each aspect and form the foundation of DataHub's knowledge graph.

Reading the Field Tables

Each aspect's field table includes an Annotations column that provides additional metadata about how fields are used:

  • ⚠️ Deprecated: This field is deprecated and may be removed in a future version. Check the description for the recommended alternative
  • Searchable: This field is indexed and can be searched in DataHub's search interface
  • Searchable (fieldname): When the field name in parentheses is shown, it indicates the field is indexed under a different name in the search index. For example, dashboardTool is indexed as tool
  • → RelationshipName: This field creates a relationship to another entity. The arrow indicates this field contains a reference (URN) to another entity, and the name indicates the type of relationship (e.g., → Contains, → OwnedBy)

Fields with complex types (like Edge, AuditStamp) link to their definitions in the Common Types section below.

Aspects

metricInfo

Core information about a Metric entity.

FieldTypeRequiredDescriptionAnnotations
externalUrlstringURL where the reference existSearchable
namestringDisplay name of the metric.Searchable
descriptionstringHuman-readable description of the metric.Searchable
createdAuditStampAudit stamp capturing when this metric was created and by whom (as reported by the source platfor...Searchable
lastModifiedAuditStampAudit stamp capturing when this metric was last modified and by whom. Equals created when no mo...Searchable
semanticModelstringThe semantic model that defines this metric.Searchable, → ModeledBy
expressionMetricExpressionThe SQL expression used to compute this metric, in one or more dialects.
aiContextAiContextAI-specific context for improved disambiguation and retrieval.

metricRelationships

Relationships from a Metric to other Metric entities.

FieldTypeRequiredDescriptionAnnotations
parentMetricstringThe parent metric of which this metric is a component or sub-metric. Used to build the metric hie...Searchable, → IsPartOf
derivedFromDerivedMetricInput[]Lineage edges to the metrics this metric is derived from. Marked isLineage so the lineage graph i...→ DerivedFrom
relatedMetricsEdge[]Non-lineage edges to semantically related metrics (e.g. metrics that share a dimension or are fre...→ RelatedTo

metricUpstreams

Physical data-flow lineage from a metric to the datasets and columns it reads. Metric-to-metric derivation lineage lives on metricRelationships.derivedFrom.

FieldTypeRequiredDescriptionAnnotations
datasetUpstreamsEdge[]Datasets this metric reads (table-level lineage).Searchable, → Consumes
fieldUpstreamsEdge[]Specific schema fields (columns) this metric reads (column-level lineage). May be populated even ...Searchable, → Consumes

ownership

Ownership information of an entity.

FieldTypeRequiredDescriptionAnnotations
ownersOwner[]List of owners of the entity.
ownerTypesmapOwnership type to Owners map, populated via mutation hook.Searchable
lastModifiedAuditStampAudit stamp containing who last modified the record and when. A value of 0 in the time field indi...

domains

Links from an Asset to its Domains

FieldTypeRequiredDescriptionAnnotations
domainsstring[]The Domains attached to an AssetSearchable, → AssociatedWith
domainAssociationsDomainAssociation[]Additional per-domain association metadata such as attribution and propagation source. A superset...

globalTags

Tag aspect used for applying tags to an entity

FieldTypeRequiredDescriptionAnnotations
tagsTagAssociation[]Tags associated with a given entitySearchable, → TaggedWith

glossaryTerms

Related business terms information

FieldTypeRequiredDescriptionAnnotations
termsGlossaryTermAssociation[]The related business terms
auditStampAuditStampAudit stamp containing who reported the related business term

institutionalMemory

Institutional memory of an entity. This is a way to link to relevant documentation and provide description of the documentation. Institutional or tribal knowledge is very important for users to leverage the entity.

FieldTypeRequiredDescriptionAnnotations
elementsInstitutionalMemoryMetadata[]List of records that represent institutional memory of an entity. Each record consists of a link,...

structuredProperties

Properties about an entity governed by StructuredPropertyDefinition

FieldTypeRequiredDescriptionAnnotations
propertiesStructuredPropertyValueAssignment[]Custom property bag.

status

The lifecycle status metadata of an entity, e.g. dataset, metric, feature, etc. This aspect is used to represent soft deletes conventionally.

FieldTypeRequiredDescriptionAnnotations
removedbooleanWhether the entity has been removed (soft-deleted). Kept for backward compatibility. When lifecyc...Searchable
lifecycleStagestringThe lifecycle stage of the entity, referencing a lifecycleStageType entity. When null, the entity...Searchable
lifecycleLastUpdatedAuditStampAttribution for the lifecycle stage transition ��� who moved the entity into its current stage an...

deprecation

Deprecation status of an entity

FieldTypeRequiredDescriptionAnnotations
deprecatedbooleanWhether the entity is deprecated.Searchable
decommissionTimelongThe time user plan to decommission this entity.
notestringAdditional information about the entity deprecation plan, such as the wiki, doc, RB.
actorstringThe user URN which will be credited for modifying this deprecation content.
replacementstring

dataPlatformInstance

The specific instance of the data platform that this entity belongs to

FieldTypeRequiredDescriptionAnnotations
platformstringData PlatformSearchable
instancestringInstance of the data platform (e.g. db instance)Searchable (platformInstance)

subTypes

Sub Types. Use this aspect to specialize a generic Entity e.g. Making a Dataset also be a View or also be a LookerExplore

FieldTypeRequiredDescriptionAnnotations
typeNamesstring[]The names of the specific types.Searchable

documentation

Aspect used for storing all applicable documentations on assets. This aspect supports multiple documentations from different sources. There is an implicit assumption that there is only one documentation per source. For example, if there are two documentations from the same source, the latest one will overwrite the previous one. If there are two documentations from different sources, both will be stored. Future evolution considerations: The first entity that uses this aspect is Schema Field. We will expand this aspect to other entities eventually. The values of the documentation are not currently searchable. This will be changed once this aspect develops opinion on which documentation entry is the authoritative one. Ensuring that there is only one documentation per source is a business rule that is not enforced by the aspect yet. This will currently be enforced by the application that uses this aspect. We will eventually enforce this rule in the aspect using AspectMutators.

FieldTypeRequiredDescriptionAnnotations
documentationsDocumentationAssociation[]Documentations associated with this asset. We could be receiving docs from different sources

browsePathsV2

Shared aspect containing a Browse Path to be indexed for an entity.

FieldTypeRequiredDescriptionAnnotations
pathBrowsePathEntry[]A valid browse path for the entity. This field is provided by DataHub by default. This aspect is ...Searchable

applications

Links from an Asset to its Applications

FieldTypeRequiredDescriptionAnnotations
applicationsstring[]The Applications attached to an AssetSearchable, → AssociatedWith

Common Types

These types are used across multiple aspects in this entity.

AuditStamp

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.

Fields:

  • time (long): When did the resource/association/sub-resource move into the specific lifecyc...
  • actor (string): The entity (e.g. a member URN) which will be credited for moving the resource...
  • impersonator (string?): The entity (e.g. a service URN) which performs the change on behalf of the Ac...
  • message (string?): Additional context around how DataHub was informed of the particular change. ...

Edge

A common structure to represent all edges to entities when used inside aspects as collections This ensures that all edges have common structure around audit-stamps and will support PATCH, time-travel automatically.

Fields:

  • sourceUrn (string?): Urn of the source of this relationship edge. If not specified, assumed to be ...
  • destinationUrn (string): Urn of the destination of this relationship edge.
  • created (AuditStamp?): Audit stamp containing who created this relationship edge and when
  • lastModified (AuditStamp?): Audit stamp containing who last modified this relationship edge and when
  • properties (map?): A generic properties bag that allows us to store specific information on this...

Relationships

Self

These are the relationships to itself, stored in this entity's aspects

  • IsPartOf (via metricRelationships.parentMetric)
  • DerivedFrom (via metricRelationships.derivedFrom)
  • RelatedTo (via metricRelationships.relatedMetrics)

Outgoing

These are the relationships stored in this entity's aspects

  • ModeledBy

    • SemanticModel via metricInfo.semanticModel
  • Consumes

    • Dataset via metricUpstreams.datasetUpstreams
    • SchemaField via metricUpstreams.fieldUpstreams
  • OwnedBy

    • Corpuser via ownership.owners.owner
    • CorpGroup via ownership.owners.owner
  • ownershipType

    • OwnershipType via ownership.owners.typeUrn
  • AssociatedWith

    • Domain via domains.domains
    • Application via applications.applications
  • TaggedWith

    • Tag via globalTags.tags
  • TermedWith

    • GlossaryTerm via glossaryTerms.terms.urn

Global Metadata Model

Global Graph

💡 Contributing to this documentation

This page is auto-generated from the underlying source code. To make changes, please edit the relevant source files in the metadata-models directory.

Tip: For quick typo fixes or documentation updates, you can click the ✏️ Edit icon directly in the GitHub UI to open a Pull Request. For larger changes and PR naming conventions, please refer to our Contributing Guide.