Skip to main content
Preview Importing lets you bring many definitions into Metrics Studio at once instead of writing each by hand. Use it when you already have metric definitions, saved queries, or query history in files. Studio previews every row first, and nothing is run or fetched. This guide shows you how to load a file, preview and fix rows, import the ones you choose, and read the report.

Before you begin

Before you start, make sure you have:
  • Access: Access to Metrics Studio and a workspace you can write to.
  • Metric app: An administrator has installed the Metric app in your account.
  • A file or pasted content: JSON for metrics (an array of envelopes, each with name, display_name, and definition, or an object with an items array). For queries, JSON records or a CSV of execution history. A file is limited to 1 MiB.
1

Open import page

  • Metrics: in the sidebar, under Build, choose Import, or choose Import metrics on the catalog. The page says “Import up to 100 metrics.”
  • Saved queries: choose Import queries on Saved queries. Import up to 1,000 records at a time.
2

Choose destination

Pick the Destination workspace. For queries, also set Source format: Saved query records (JSON) or Execution history (CSV). History needs a History source or source location, for example example://query-history. It identifies where execution IDs came from so the same ID from two systems is not confused. Studio does not fetch it.
3

Add content

Choose a file, or paste into Import content. Loading a file replaces what is in the box. Choosing a file larger than 1 MiB shows an error, and each Registry request must fit within 4 MiB.
An array of envelopes with name, display_name, and definition, or an object with an items array. Source location, revision, and metadata are optional.
4

Preview and fix rows

Choose Preview mappings and duplicates. Studio checks every row and labels it. For metrics: Ready, Needs correction, Name already used, Saved, Failed, or Outcome unknown. Name checks include archived metrics. For queries: Ready, Needs correction, Existing match, Saved, Failed, Unconfirmed, or Skipped.
  • To fix a row, choose Edit row, change its JSON, and choose Apply and recheck row.
  • A name repeated inside the file is blocked. Choose a distinct name.
  • For a metric whose name exists, choose Find this name in the metric library or Find archived metrics with this name.
  • For a query with an Existing match, you can choose Attach history evidence to add history to the match in a new revision (the SQL and dialect must be the same, and executions already imported are skipped), or Create a separate query with this SQL. A name that already exists cannot be overridden.
Grouping compares SQL text, dialect, and parameters. It does not verify meaning.
5

Import chosen rows

For metrics, tick I reviewed the destination and selected metric definitions. The final button stays disabled until you do and at least one row is selected. Then choose Import selected rows (queries: Import selected ()).
Saved rows and rows with an unknown outcome cannot be replayed. If Studio says “The request may have completed. This row is locked against retry.”, inspect the destination before you do anything else. An unknown outcome stops the batch until you choose to continue.
Rows that failed definitively can be corrected and imported again.
6

Verify import

Open Import report to see each row’s result, and choose Copy import report to keep it. Studio holds the report only on this page, so copy it before you leave. Saved rows link to the saved item with its revision. Then open the catalog or Saved queries and confirm the items are there. Check each item’s release state, because releasing is a separate step.

Next steps

See also