LogoLogo
Login to CortexBook a DemoCortex Academycortex.io
  • Cortex Docs
  • Cortex Quick Start
  • Ingesting data into Cortex
    • Managing Entities
      • Adding entities
        • Add services
        • Add domains
        • Add teams
        • Add custom entity types
        • Defining dependencies
      • Entity details page
      • Defining ownership
      • Defining relationship types
      • Grouping entities
      • Adding external documentation
      • Adding Deploy data
      • Adding custom data
      • Viewing discovered entities
      • Archiving entities
      • Relationship graph
      • Using On-call Assistant for incidents
      • Managing Terraform infra in Cortex
    • Managing Catalogs
    • Integrations
      • Internally hosted integrations
      • ArgoCD
      • AWS
      • Azure DevOps
      • Azure Resources
      • BambooHR
      • Bitbucket
      • BugSnag
      • Buildkite
      • Checkmarx
      • CircleCI
      • ClickUp
      • Codecov
      • Coralogix
      • Custom webhook integrations
      • Datadog
      • Dynatrace
      • Entra ID (Azure AD)
      • FireHydrant
      • GitHub
      • GitLab
      • Google
      • Grafana
      • incident.io
      • Instana
      • Jenkins
      • Jira
      • Kubernetes
      • LaunchDarkly
      • Lightstep
      • Mend
      • Microsoft Teams
      • New Relic
      • Okta
      • Opsgenie
      • PagerDuty
      • Prometheus
      • Rollbar
      • Rootly
      • Sentry
      • ServiceNow
      • Slack
      • Snyk
      • SonarQube
      • Splunk Observability Cloud (SignalFx)
      • Splunk On-Call (VictorOps)
      • Sumo Logic
      • Veracode
      • Wiz
      • Workday
      • xMatters
  • Scorecards
    • Initiatives and Action items
      • Creating issues based on Initiatives
    • Scorecard rule exemptions
    • Scorecard rule filters
    • Scorecard examples
    • Scorecards as code
  • Reports
    • Executive report
    • All Scorecards report
    • Bird's eye report
    • Progress report
    • Report card
  • Eng Intelligence
    • Custom Metrics
    • Jira Metrics
    • Metrics Explorer (Beta)
  • Cortex Query Language (CQL)
    • Using CQL reports
    • Using JQ in Cortex
  • Workflows
    • Creating a Workflow
      • Workflows as code
    • Blocks
    • Running a Workflow
    • Registering a Scaffolder template
      • Scaffolder advanced usage
    • Using a Workflow to sync in ArgoCD
    • Kicking off a Jenkins pipeline in a Workflow
    • Calling internal service endpoints in a Workflow
  • Plugins
    • Creating a plugin
      • Creating a plugin proxy
    • Migrating Backstage plugins to Cortex
  • Engineering homepage
  • Workspace Settings
    • Using GitOps for Cortex
      • GitOps logs
    • Managing users
      • Roles and permissions
        • Custom roles
        • Team ownership entity editing
      • Configuring SSO
        • Microsoft Entra ID
        • Google
        • Other OIDC providers
        • Okta
          • Okta SCIM
      • Configuring identity mappings
      • Onboarding management
    • API keys, secrets, and tokens
      • Secrets
      • Personal tokens
    • Audit logs
    • Entity settings
      • Data verification
      • Auto archiving entities
    • IP allowlist
    • Notifications
      • Notification logs
    • Customizing your workspace
    • Using search in Cortex
  • Cortex API
    • REST API operations
      • API Keys
      • Audit Logs
      • Catalog Entities
      • Custom Data
        • Custom Data (Advanced)
      • Custom Events
      • Custom Metrics
      • Dependencies
      • Deploys
      • Discovery Audit
      • Docs
      • Eng Intel: User Labels
      • Entity Relationship Types (Beta)
      • Entity Relationships (Beta)
      • Entity Types
      • GitOps Logs
      • Groups
      • Initiatives
      • Integrations APIs
        • Azure Active Directory (Entra ID) API
        • Azure Resources API
        • AWS API
        • Azure DevOps API
        • CircleCI API
        • Coralogix API
        • Datadog API
        • GitHub API
        • GitLab API
        • incident.io API
        • LaunchDarkly API
        • New Relic API
        • PagerDuty API
        • Prometheus API
        • SonarQube API
      • IP Allowlist
      • Notification Logs
      • On call
      • Packages
      • Plugins
      • Queries
      • SCIM
      • Scorecards
      • Secrets
      • Team Hierarchies
      • Teams
      • Workflows
Powered by GitBook
On this page
  • Understanding relationship types in Cortex
  • View relationship types
  • View all configured relationship types
  • View relationships on entity pages
  • Manage relationship types
  • Create relationship types and relationship connections
  • Edit relationship types
  • Delete relationship types
  • Entity relationship CQL

Was this helpful?

Export as PDF
  1. Ingesting data into Cortex
  2. Managing Entities

Defining relationship types

Last updated 10 days ago

Was this helpful?

The ability to add relationship types is in beta. Please reach out to Cortex Customer Engineering with any feedback.

Relationship types allow you to define, manage, and visualize relationships between entities within your Cortex workspace, ensuring your organization's structures and dependencies are accurately represented.

Understanding relationship types in Cortex

A relationship type defines how two entities relate to either other, and constrains the types of entities that can be the source and destination entities within the relationship.

Cortex provides multiple options for defining a relationship:

  • Entity relationship: As described on this page, you can customize a relationship type (hierarchical or cyclical) between any entity type.

  • Team hierarchy: You can define a hierarchical relationship between team entities. Learn more in .

  • Domain hierarchy: You can define a hierarchical relationship between domain entities. You can also configure inheritance; the owner of an entity can be inherited from entities higher in the domain hierarchy. Learn more in .

  • Dependencies: You can define a cyclical relationship between non-team entities. Learn more in .

View relationship types

View all configured relationship types

To view all relationship types, go to Catalogs > All entities then click the .

To view the details of a specific relationship type, click its name from the list.

View relationships on entity pages

In the example entity below, there are three destination entities in an "App Components" relationship:

Manage relationship types

Create relationship types and relationship connections

Create relationship types in the Cortex UI

  1. In the upper right corner, click Create > Create new relationship type.

  2. Configure the details and entity types:

    1. Name: Enter a name for the relationship type.

    2. Identifier: Enter a unique identifier, used to specify this relationship in YAML definitions for this relationship type.

    3. Description: Add a description of the relationship to help others understand its purpose.

    4. Create relationship type catalog: Enable this option to create a catalog for this relationship type.

    5. Source entity types: Search for and select the entity types which will be the source for this relationship. Selecting no entity type means that all entity types are available as sources.

      • You can also customize the singular and plural wording of the entity types and the cardinality.

    6. Destination entity types: Search for and select the entity types which will be the destination for this relationship. Selecting no entity type means that all entity types are available as destinations.

      • You can also customize the singular and plural wording of the entity types and the cardinality.

  3. Configure the relationship constraints:

    1. Architecture: If you are configuring hierarchical data, such as an org chart, we recommend choosing Acyclical. If you are configuring graph-like data, such as dependencies, we recommend choosing Cyclical.

    2. Definition location: Configure where relationships can be defined — from destination entities, from source entities, or from either.

  4. Click Create.

Create relationship connections between entities in the UI

  1. Click the Relationships tab.

  2. At the bottom of the page, click Save changes.

Create relationship connections between entities in the entity descriptor

In the example below, a source entity's YAML has a defined relationship type called app-components and has destination entities production-ui and backend-app.

  x-cortex-relationships:
  - type: app-components
    destinations:
    - tag: production-ui
    - tag: backend-app

The relationship between entities in Cortex is based on the relationship being defined in the entity's YAML file; Cortex does not set hierarchies or relationships based on a YAML file's location in your repository.

Create relationship types via the API

Documentation is coming soon for managing relationship types via the Cortex API. Please reach out to your Cortex Customer Success Manager with any questions.

Edit relationship types

To edit an existing relationship type:

  1. Make any necessary changes, then at the bottom of the page, click Save.

Delete relationship types

  1. Click the relationship type name.

Entity relationship CQL

Entity relationship destinations

All recursive destinations an entity for a relationship type, with an optional depth parameter to expand results

Definition: entity.destinations(relationshipType = "my-relationship")

Examples

You could write a Scorecard rule to ensure that an entity has at least one destination with the "my-relationship" type:

entity.destinations(relationshipType = "my-relationship").length > 0
Entity relationship sources

All recursive sources an entity for a relationship type, with an optional depth parameter to expand results

Definition: entity.sources(relationshipType = "my-relationship")

Examples

You could write a Scorecard rule that ensures an entity has at least one source with the "my-relationship" type:

entity.sources(relationshipType = "my-relationship").length > 0

If an entity is part of a relationship, you can view this information on its . Click Relationships in the left sidebar to see the different relationship types that the entity belongs to.

Navigate to Catalogs > All entities then click the .

After creating the relationship type, you can configure connections between entities in a relationship. You can do this via the or in the UI, as described below:

Navigate to an . In the upper right corner, click Configure entity.

At the top of the Relationship Type section, click the dropdown to select which relationship type you are configuring connections for.

After selecting the relationship type, you can search for and select entities in the Sources dropdown and in the Destinations dropdown.

Relationship types must be or via the API. You can configure relationship connections between entities in the entity YAML.

In a source , you can use the x-cortex-relationships tag to define its destination entities.

Navigate to Catalogs > All entities then click the .

In the row containing the relationship type, click the pen icon.

Navigate to Catalogs > All entities then click the .

On its details page, in the upper right corner, click Remove.

entity details page
Relationship types tab
entity details page
Relationship types tab
Relationship types tab
entity descriptor
created in the Cortex UI
Defining dependencies
Relationship types tab
entity's YAML
Add domains
Add teams
On the Entities page, click the "Relationship types" tab.
In the upper right, click Create, then click "Create new relationship type".