Skip to main content
The Contextualization Quality Dashboard deployment pack answers two questions: how much of your data is linked, and what should you fix first? It shows how completely the assets, equipment, time series, maintenance records, files, P&ID annotations, and 3D objects in your Cognite Data Fusion (CDF) project are linked to each other. You get a score for each area, trends over time, and lists of the exact items to fix. The pack has two modules. A scheduled backend, deployed with the Cognite Toolkit, calculates the scores. A dashboard app, deployed with the Cognite CLI, shows them.
The Contextualization Quality Dashboard is a cherry-pickable deployment pack with two modules: the backend and the dashboard app. Deploy the backend first. Until a run has completed, the app opens a first-run screen where you can start one.

Who it’s for

Target personas:
  • Business and data owners — track contextualization progress and decide where to invest.
  • Data engineers — deploy the backend and the app, and run and troubleshoot the metrics workflow.
  • Subject matter experts — operations and reliability teams who use the lists of unlinked items to prioritize fixes.
Use this pack when:
  • You want a repeatable, quantitative measure of how well your data is contextualized, with a baseline and a trend.
  • You want to find gaps, such as time series with no asset, equipment that is not tied to an asset, or files that are not annotated.
  • You want results per facility (an instance space) or per location filter.
When not to use this pack:

What’s included

The backend reads your data model views. It does not create or modify them.

Prerequisites

Verify all of the following before you start:
  • The Records and Streams services are available in your CDF project. If the stream can’t be created, ask Cognite to enable these services for your project. Cognite Functions and data workflows must be available as well.
  • The Cognite Toolkit version 0.8 or later is installed, and a cdf.toml file exists in your project root. See Setting up.
  • The record_views alpha flag is enabled in cdf.toml, because the containers are record containers:
    cdf.toml
  • Authentication is configured and verified, and the deploying identity has the access it needs. See Authentication and authorization.
  • Two identity provider groups, one for the function and one for the dashboard users, and a client that is a member of the function group, for the schedule.
  • Your project has data in the views you want to score. The defaults target the core data model (cdf_cdm) and the process industries data model (cdf_idm).
  • To deploy the app: Node.js 20 or later and npm.

Install and deploy

Deployment at a glance:
  1. Check the prerequisites.
  2. Deploy the backend.
  3. Run the backend once.
  4. Deploy the dashboard app.

Backend

1

Add the module

Run cdf modules add and select Contextualization Quality Dashboard > Contextualization Quality Dashboard Backend.The Toolkit creates the module under modules/dashboards/context_quality/ and adds it to your config.<env>.yaml.
2

Set the environment values

Add these values to your .env file. Don’t commit it: it contains the client secret.
3

Configure the module

In the module’s section of config.<env>.yaml, set at least metricsSourceSpaces: cdf_cdm and cdf_idm, plus the instance spaces that hold your assets, equipment, time series, files, and so on. The function can only read these spaces.cdf modules add copies every variable into this file. Keep them all, because cdf build leaves any missing variable as {{ ... }}. The other variables have working defaults. See Backend variables.
Then build and deploy:
1

Build deployment artifacts

The Toolkit substitutes template variables and writes artifacts to the build/ directory. If you need to change the project name or any variables marked <change_me>, edit config.<env>.yaml first — see Configure, build, and deploy modules.
2

Dry-run the deployment

Inspect the output and confirm that configurations look correct before deploying.
3

Deploy to CDF

The Toolkit deploys only configurations that have changed since the last run.
4

Set up CI/CD (optional)

For governed production deployments, automate build, dry-run, and deploy in a pipeline. See Set up CI/CD pipelines.
Never recreate the stream of a backend that is already deployed. If the backend already exists in your project, set the variables to its existing names and stream template, and confirm that the dry run shows the containers, views, and stream as unchanged.
If your project stores function code in a data modeling space, add that space to the function definition before you deploy.
In a data-modeling-only project (for example, dataModelingType: DATA_MODELING_ONLY), Cognite Functions stores function code in a data modeling space, so the function needs a space. Add the external ID of an existing space that the deploying identity can write to, to functions/context_quality.Function.yaml, and add it again after each module update, which overwrites the file:
functions/context_quality.Function.yaml

Run the backend once

The first scheduled run follows the next trigger time. To get data now, start the workflow manually:
1

Open the workflow

In CDF, go to Data fusion > Integrate > Data workflows, open wf_context_quality_metrics, and select Run.
2

Start the run

Use this input:
With "scope": "all", the run measures every built-in dimension, but not your own configured links. See Run some dimensions only.You can also start the run from the dashboard. See Start a run from the app.
3

Wait for the finalize task

A run is complete when its finalize task succeeds. Only then does the dashboard show it. The export task that follows only builds the Excel workbook. A failed run is never shown, and the previous run stays current.

Dashboard app

Deploy the app after the backend.
1

Add the module

Run cdf modules add and select Contextualization Quality Dashboard > Contextualization Quality Dashboard App. The Toolkit creates the module under modules/tools/apps/context_quality_dashboard/. You can also copy that folder from the Cognite Library repository.
2

Move the app out of the modules folder

The Toolkit deploys the backend, but the app is a Fusion app that you deploy with the Cognite CLI. From your Toolkit project root, move it from modules/ to the directory where you keep your Fusion apps, and go into it:
If you leave the app in modules/, cdf build also picks it up. The auth/ folder in the app contains a placeholder group that exists only so that the Toolkit accepts the module. Don’t deploy it. People get access to the dashboard from the backend’s dashboard users group. See Access.
3

Point the app at your project

In app.json, set the first entry in deployments:
app.json
Leave deployClientId and deploySecretName empty to deploy as yourself. For a non-interactive deploy, deploySecretName is the name of an environment variable that holds the client secret, never the secret itself.
4

Tell the app which backend to read

Copy .env.example to .env.local. The defaults match the backend’s defaults. If you renamed resources in the backend’s config.<env>.yaml, see Dashboard app variables.The build inlines these values, so set them before you build. An app built without them shows only a configuration screen.
5

Build, deploy, publish, and activate

Raise versionTag in app.json for each release.

Verify the deployment

  1. cdf deploy finishes without errors and reports the function, workflow, stream, containers, views, spaces, data set, and groups.
  2. In CDF, go to Data fusion > Build solutions > Functions and confirm that fn_context_quality_metrics shows Ready. It can take a few minutes after deploy.
  3. A run of wf_context_quality_metrics finishes with finalize succeeded.
  4. npx @cognite/cli apps status shows the app version as active, and the app opens in CDF.
  5. The Overview page shows one card per dimension with a score and a trend.

Configuration reference

Backend variables

Set these in the module’s section of config.<env>.yaml.

Divide a run into smaller calls

A run is divided into function calls, and a call can run for at most 10 minutes. If a call times out, start the run with smaller shards for that run only, without a deploy:
The planning object accepts shardTargetEntities (default 100,000), shardTargetTimeSeries (default 20,000), maxShards (default 150, at most 190), and maxConcurrentShards (default 2). If the calls would not fit a run, the plan makes the target larger until they do. For a very large project, run fewer dimensions at a time with scope. To make a setting permanent, set the matching metrics... variable and deploy again.

Run some dimensions only

The scope input says which dimensions a run measures. The dimension names are asset-hierarchy, equipment-asset, time-series, maintenance, files, model-3d, and file-annotation. The dashboard shows each dimension from the latest complete run that covered it.

Dashboard app variables

Set these in .env.local before you build the app. To run the app locally against your project, or with sample data, see the app README.

Use the dashboard

The Alerts page is a placeholder: the backend doesn’t produce alerts yet. To get every unlinked item of the latest run, with one sheet per metric, select Download all unlinked (Excel). The workbook is built after the run completes, so it can be missing if the export failed. Filter by Space (a facility, meaning an instance space) or by Location (a location filter). A score is always the items that pass divided by the items that apply. A metric that couldn’t be measured for a scope shows as Not applicable, not as 0%.

Start a run from the app

By default, the dashboard never starts a run by itself. It needs VITE_CQ_WORKFLOW_ID and VITE_CQ_WORKFLOW_VERSION, and a user who can start runs.
  • First run: on a project with no completed run, the Configuration page opens a first-run screen. Select Run built-in checks.
  • Later runs: use Refresh to re-read the latest results, the run button on a dimension page to re-measure that dimension, or Run with this file on the Configuration page to include your own links.
  • If a run fails: the run banner turns red. Open the run details from the banner, or the execution of wf_context_quality_metrics in Data fusion > Integrate > Data workflows, to see which task failed and why.

Configure your own metrics

Upload a YAML or JSON file that lists data model links. Each entry names a model and the View.property links to count. For example:
Each View.property must be a direct relation, or a list of them. A text property, such as a time series “equipment” string, fails with ... is not a direct relation, so it is not a link. Configured metrics only work for models and instance spaces that the run identity can read. For a model in another space, add that schema space to dataModelsAcl and its instance spaces to metricsSourceSpaces. Don’t change those scopes to all. Without this, the run fails with a 403 before anything is written.

Metrics reference

Each dimension has a headline metric. A score is always items that pass divided by items that apply. Each dimension also has coverage metrics (assets that have at least one linked item), completeness metrics (a field is filled in, such as a serial number or a file description), and freshness (updated within metricsFreshnessDays, 30 by default). For time series, freshness means the latest datapoint is within that window. Items can be excluded before counting, for example synthetic time series or decommissioned equipment. The backend counts every exclusion in the run log, so nothing is dropped silently, but the dashboard doesn’t list them yet. Tiers are an optional importance grade from 1 to 3 for assets, based on your own mapping of types to tiers.

Access

A run started from the app executes as the signed-in user: the app opens a session from their token. The dashboard users group is read-only and isn’t enough to start a run.
Give people who start runs their own group rather than adding them to producer_context_quality_function_dev, which the schedule’s client uses. That group also has functionsAcl write on all functions and timeSeriesAcl read on all time series, so its members could change any function in the project and read every time series.

Architecture

The backend separates computing from showing. A data workflow runs a function in Cognite Functions that computes raw counts and appends them to a Records stream as an immutable run log. The app reads the stream, groups the counts by dimension, and sums them for the space or location you select. A run writes a started marker, then its rows of counts, and last a complete marker. For each dimension, the dashboard shows the latest run that has a complete marker and that measured that dimension. See Run some dimensions only. After the complete marker, the export task builds the Excel workbook. If it fails or is slow, the run is still shown, and Run notes reports export-failed. Overview can then show scores while the Excel download is missing or stale. The backend never updates or deletes a record, and it adds new properties only as optional ones, so an older run stays readable.

Troubleshooting

For issues not covered here, contact Cognite support.

Support

Last modified on November 24, 2026