Skip to main content

Check out Port for yourself ➜ 

Ingest LinearB metrics into Port

If you're currently using LinearB, this guide shows how to migrate those metrics into Port using the Ocean Custom Integration framework so you can consolidate on a single platform. Once ingested, you can compare LinearB data against Port's native metrics, validate parity, and transition to Port as your single source of truth for engineering performance. From there, apply scorecards, trigger automations, and use AI agents to uncover insights across your entire engineering organization.

Port's Agentic Engineering Platform natively includes Engineering Intelligence

Port is an Agentic Engineering Platform with native Engineering Intelligence it tracks DORA metrics, delivery health, developer productivity, AI tool adoption, and more, all tied to the services, teams, and infrastructure in your catalog. Rather than stopping at dashboards, Port drives an end-to-end feedback loop: measure, act, and verify impact through scorecards, agentic workflows, automations, and AI-driven recommendations. See Why Port for Engineering Intelligence to learn more.

Common use cases

  • Transition from LinearB to a unified Agentic Engineering Platform that includes Engineering Intelligence.
  • Run LinearB and Port side by side to validate metric parity before fully migrating.
  • Leverage Port AI agents to surface patterns, bottlenecks, and recommendations from your engineering data.
  • Define scorecards on ingested data to enforce quality standards and track adherence over time.
  • Set up Port workflows and automations that react to metric changes (e.g. notify when cycle time spikes or deployment frequency drops).

Supported metrics

The integration ingests the following metrics from LinearB's Measurements V2 API:

DORA metrics (organization-level):

  • releases.count — number of deployments, used to compute deployment frequency.
  • pm.mttr — mean time to recovery in minutes.
  • pm.cfr.issues.done — incidents that reached a done state (change failure rate).

Pull request metrics (team-level):

  • branch.computed.cycle_time — full PR cycle time (coding + pickup + review + deploy).
  • branch.time_to_review — pickup time before first review.
  • branch.review_time — time spent in review.
  • branch.time_to_prod — time from merge to production.
  • branch.time_to_pr — coding time before PR is opened.
  • pr.merged — count of merged PRs.
  • branch.state.active — number of active branches (PRs in progress).
  • commit.activity_days — days with developer activity.
LinearB API availability

The Measurements V2 API is available on LinearB Business and Enterprise plans. Free trials may not include API access. If you're evaluating LinearB, sign up for a trial and confirm API availability with their team.

Prerequisites

To use this integration, you need:

  • A Port account with the onboarding process completed.
  • A LinearB account on a Business or Enterprise plan.
  • A LinearB API token generated from Company Settings > API Tokens in the LinearB UI. Learn more.

Installation

Custom Ocean integration

This integration was created using the custom Ocean integration builder.
Please note that:

  1. This integration will not be listed in the Data sources page of your Port application, and must be installed manually using the instructions on this page.
  2. This integration will not create components (e.g. blueprints, mapping, etc.) in your portal automatically, you will need to create them manually using the instructions on this page.

Choose one of the following installation methods to deploy the Ocean Custom Integration:

This is the simplest method — Port hosts and manages the integration for you.

  1. Go to your Data sources page.

  2. Click + Data source.

  3. Select the Custom Integration option.

  4. Fill in the following connection settings:

    SettingValue
    Base URLhttps://public-api.linearb.io
    Auth Typeapi_key
    API KeyYour LinearB API token
    Identifiermy-ocean-linearb-integration
  5. Click Save & Continue.

Set up data model

Port's open data model lets you shape blueprints to match your needs. This guide uses a single engineering_metric blueprint that stores metrics from LinearB and any other analytics source. Every metric is tagged with source and category, so you can add providers like Swarmia or GetDX later without restructuring your model.

If you've already created this blueprint, just add linearb to the source enum. If this is your first time setting up external metrics, create the blueprint as shown below.

  1. Go to the Builder page of your portal.

  2. Click on + Blueprint.

  3. Click on the {...} button in the top right corner, and choose Edit JSON.

  4. Add this JSON schema and click Save:

    Engineering metric blueprint (click to expand)
    {
    "identifier": "engineering_metric",
    "description": "A time-windowed snapshot of engineering performance metrics. Source-tagged to enable multi-provider ingestion and data parity validation.",
    "title": "Engineering Metric",
    "icon": "Analytics",
    "schema": {
    "properties": {
    "source": {
    "type": "string",
    "title": "Source",
    "description": "The tool this metric was ingested from",
    "enum": ["swarmia", "linearb"],
    "enumColors": {
    "swarmia": "blue",
    "linearb": "turquoise"
    }
    },
    "category": {
    "type": "string",
    "title": "Category",
    "description": "The metric category",
    "enum": ["dora", "pull_request"],
    "enumColors": {
    "dora": "purple",
    "pull_request": "green"
    }
    },
    "window": {
    "type": "string",
    "title": "Window",
    "description": "The time window this snapshot covers",
    "enum": ["7d", "30d"]
    },
    "start_date": {
    "type": "string",
    "format": "date-time",
    "title": "Start date"
    },
    "end_date": {
    "type": "string",
    "format": "date-time",
    "title": "End date"
    },
    "team_name": {
    "type": "string",
    "title": "Team name",
    "description": "Raw team name from the source system, used to match Port teams"
    },
    "deployment_frequency": {
    "type": "number",
    "title": "Deployment frequency (per day)"
    },
    "change_lead_time_minutes": {
    "type": "number",
    "title": "Change lead time (minutes)"
    },
    "change_failure_rate": {
    "type": "number",
    "title": "Change failure rate (%)"
    },
    "mttr_minutes": {
    "type": "number",
    "title": "Mean time to recovery (minutes)"
    },
    "deployment_count": {
    "type": "number",
    "title": "Deployment count"
    },
    "cycle_time_seconds": {
    "type": "number",
    "title": "Cycle time (seconds)"
    },
    "review_rate": {
    "type": "number",
    "title": "Review rate (%)"
    },
    "time_to_first_review_seconds": {
    "type": "number",
    "title": "Time to first review (seconds)"
    },
    "prs_merged_per_week": {
    "type": "number",
    "title": "PRs merged per week"
    },
    "merge_time_seconds": {
    "type": "number",
    "title": "Merge time (seconds)"
    },
    "prs_in_progress": {
    "type": "number",
    "title": "PRs in progress"
    },
    "contributors": {
    "type": "number",
    "title": "Contributors"
    },
    "review_time_seconds": {
    "type": "number",
    "title": "Review time (seconds)"
    }
    },
    "required": ["source", "category", "window", "end_date"]
    },
    "mirrorProperties": {
    "team_identifier": {
    "title": "Team identifier",
    "path": "team.$identifier"
    }
    },
    "calculationProperties": {
    "cycle_time_hours": {
    "title": "Cycle time (hours)",
    "calculation": "if .properties.cycle_time_seconds then (.properties.cycle_time_seconds / 3600) else null end",
    "type": "number"
    }
    },
    "aggregationProperties": {},
    "relations": {
    "team": {
    "title": "Team",
    "target": "_team",
    "required": false,
    "many": false
    }
    }
    }

Configuration

After installation, define which endpoints to sync in your integration configuration. Each resource maps an API endpoint to Port entities using JQ expressions to transform the data.

Key mapping components:

  • kind: The API endpoint path (combined with your base URL).
  • selector.method: HTTP method (POST for LinearB's Measurements V2 API).
  • selector.body: JQ expression evaluated to produce the JSON request body.
  • selector.data_path: JQ expression pointing to the array of items in the response.
  • port.entity.mappings: How to map API fields to Port entity properties.

For more details on how the Ocean Custom Integration works, see the overview.

LinearB metric units

LinearB returns time-based metrics in minutes. The mappings below convert these to seconds (multiplying by 60) to keep the data model consistent across sources.

To configure the mappings:

  1. Go to your data sources page.

  2. Find your LinearB integration in the list.

  3. Click on the integration to open the mapping editor.

  4. Add the resource mapping configurations below.

    DORA metrics mapping (click to expand)

    This mapping fetches organization-level DORA metrics for the last 30 days:

    resources:
    - kind: /api/v2/measurements
    selector:
    query: 'true'
    method: POST
    body: >-
    {
    "requested_metrics": [
    {"name": "releases.count"},
    {"name": "pm.mttr"},
    {"name": "pm.cfr.issues.done"}
    ],
    "group_by": "organization",
    "roll_up": "custom",
    "time_ranges": [
    {
    "after": ((now - 2592000) | strftime("%Y-%m-%d")),
    "before": (now | strftime("%Y-%m-%d"))
    }
    ],
    "return_no_data": true
    }
    data_path: '.[0].metrics'
    port:
    entity:
    mappings:
    identifier: '"linearb-dora-30d-" + (now | strftime("%Y-%m-%d"))'
    title: '"DORA metrics (30d) - " + (now | strftime("%Y-%m-%d"))'
    blueprint: '"engineering_metric"'
    properties:
    source: '"linearb"'
    category: '"dora"'
    window: '"30d"'
    start_date: '((now - 2592000) | strftime("%Y-%m-%dT00:00:00Z"))'
    end_date: '(now | strftime("%Y-%m-%dT00:00:00Z"))'
    deployment_count: '."releases.count"'
    deployment_frequency: '((."releases.count" // 0) / 30 * 100 | floor) / 100'
    mttr_minutes: '."pm.mttr"'
    change_failure_rate: '."pm.cfr.issues.done"'
    Pull request metrics by team mapping (click to expand)

    This mapping fetches team-level pull request metrics for the last 30 days. Each team produces a separate entity:

      - kind: /api/v2/measurements
    selector:
    query: 'true'
    method: POST
    body: >-
    {
    "requested_metrics": [
    {"name": "branch.computed.cycle_time", "agg": "avg"},
    {"name": "branch.time_to_review", "agg": "avg"},
    {"name": "branch.review_time", "agg": "avg"},
    {"name": "branch.time_to_prod", "agg": "avg"},
    {"name": "branch.time_to_pr", "agg": "avg"},
    {"name": "pr.merged"},
    {"name": "branch.state.active"},
    {"name": "commit.activity_days"}
    ],
    "group_by": "team",
    "roll_up": "custom",
    "time_ranges": [
    {
    "after": ((now - 2592000) | strftime("%Y-%m-%d")),
    "before": (now | strftime("%Y-%m-%d"))
    }
    ],
    "return_no_data": true
    }
    data_path: '.[0].metrics'
    port:
    entity:
    mappings:
    identifier: '"linearb-pr-" + (.team_name | ascii_downcase | gsub("[^a-z0-9]+"; "-") | ltrimstr("-") | rtrimstr("-")) + "-30d-" + (now | strftime("%Y-%m-%d"))'
    title: '.team_name + " - PR metrics (30d)"'
    blueprint: '"engineering_metric"'
    properties:
    source: '"linearb"'
    category: '"pull_request"'
    window: '"30d"'
    start_date: '((now - 2592000) | strftime("%Y-%m-%dT00:00:00Z"))'
    end_date: '(now | strftime("%Y-%m-%dT00:00:00Z"))'
    team_name: .team_name
    cycle_time_seconds: '(."branch.computed.cycle_time:avg" // 0) * 60'
    time_to_first_review_seconds: '(."branch.time_to_review:avg" // 0) * 60'
    review_time_seconds: '(."branch.review_time:avg" // 0) * 60'
    merge_time_seconds: '(."branch.time_to_prod:avg" // 0) * 60'
    change_lead_time_minutes: '(."branch.computed.cycle_time:avg" // 0)'
    prs_merged_per_week: '((."pr.merged" // 0) / 4.29 * 10 | floor) / 10'
    prs_in_progress: '."branch.state.active"'
    contributors: '."commit.activity_days"'
    relations:
    team: '.team_name | ascii_downcase | gsub("[^a-z0-9]+"; "-") | ltrimstr("-") | rtrimstr("-")'
    Relating metrics to your catalog

    The team relation attempts to match LinearB team names to Port _team entities by slugifying the team name (e.g. Platform Team becomes platform-team). If no matching team exists, the relation will be empty but the entity will still be created.

Visualize metrics

Once the integration has synced at least once, your portal contains LinearB metrics alongside GitHub services, pull requests, and teams.

If this is your first external metrics integration, follow the dashboard setup below.

Create a dashboard

  1. Navigate to the Catalog page of your portal.

  2. Click on the + New button in the left sidebar.

  3. Select New dashboard.

  4. Name the dashboard Engineering Performance.

  5. Input Track engineering metrics from LinearB alongside GitHub services and teams under Description.

  6. Select the Analytics icon.

  7. Click Create.

Add widgets

Deployment frequency widget (click to expand)
  1. Click + Widget and select Number Chart.

  2. Fill in the following details:

    • Title: Deployment Frequency (avg, 30d).
    • Icon: Rocket.
    • Blueprint: engineering_metric.
    • Chart type: Aggregate by property.
    • Property: deployment_frequency.
    • Function: Average.
    • Average of: total.
    • Custom unit: deploys/day.
    • Add a filter: category = dora and window = 30d.
  3. Click Save.

Change lead time widget (click to expand)
  1. Click + Widget and select Number Chart.

  2. Fill in the following details:

    • Title: Change Lead Time (avg, 30d).
    • Icon: Clock.
    • Blueprint: engineering_metric.
    • Chart type: Aggregate by property.
    • Property: change_lead_time_minutes.
    • Function: Average.
    • Average of: total.
    • Custom unit: minutes.
    • Add a filter: category = dora and window = 30d.
  3. Click Save.

MTTR widget (click to expand)
  1. Click + Widget and select Number Chart.

  2. Fill in the following details:

    • Title: MTTR (avg, 30d).
    • Icon: Metrics.
    • Blueprint: engineering_metric.
    • Chart type: Aggregate by property.
    • Property: mttr_minutes.
    • Function: Average.
    • Average of: total.
    • Custom unit: minutes.
    • Add a filter: category = dora and window = 30d.
  3. Click Save.

PR cycle time widget (click to expand)
  1. Click + Widget and select Number Chart.

  2. Fill in the following details:

    • Title: PR Cycle Time (avg, 30d).
    • Icon: Clock.
    • Blueprint: engineering_metric.
    • Chart type: Aggregate by property.
    • Property: cycle_time_hours.
    • Function: Average.
    • Average of: total.
    • Custom unit: hours.
    • Add a filter: category = pull_request and window = 30d.
  3. Click Save.

Metrics by source pie chart (click to expand)
  1. Click + Widget and select Pie chart.

  2. Fill in the following details:

    • Title: Metrics by Source.
    • Icon: Analytics.
    • Blueprint: engineering_metric.
    • Breakdown by property: source.
  3. Click Save.

Metrics by team pie chart (click to expand)
  1. Click + Widget and select Pie chart.

  2. Fill in the following details:

    • Title: PR Metrics by Team (30d).
    • Icon: Team.
    • Blueprint: engineering_metric.
    • Breakdown by property: team_name.
    • Add a filter: category = pull_request and window = 30d.
  3. Click Save.

Engineering metrics table (click to expand)
  1. Click + Widget and select Table.

  2. Fill in the following details:

    • Title: Engineering Metrics.
    • Blueprint: engineering_metric.
  3. Click Save.

  4. Click ... on the widget and select Customize table.

  5. Under Manage Properties, add:

    • source.
    • category.
    • window.
    • team_name.
    • deployment_frequency.
    • change_lead_time_minutes.
    • mttr_minutes.
    • cycle_time_hours.
    • prs_merged_per_week.
    • end_date.
  6. Click the save icon in the top right corner of the widget.

Build these metrics natively in Port

Importing LinearB data helps during a transition, but Port can produce the same metrics without a third-party analytics tool. Port's built-in integrations pull data from your source control, CI/CD pipelines, project management tools, and AI coding assistants, then compute metrics directly inside the catalog.



Metrics like PR throughput, cycle time, deployment frequency, and review health are derived automatically using aggregation properties and calculation properties. You can slice them by service, team, group, or organization, and correlate with ownership data, Jira issues, AI adoption metrics, and anything else in your catalog.

Integration coverage

Port connects to tools across the full SDLC source control, planning, security, infrastructure, CI/CD, and AI coding tools through various integrations. Check Port's integration library for available integrations. Data flows into the catalog continuously, ready to power dashboards, scorecards, and automations without any custom ingestion code.

Dive deeper into Port's native Engineering Intelligence:

Next steps