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, anddefinition, or an object with anitemsarray). 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.
- Metrics (JSON)
- Saved query records (JSON)
- Execution history (CSV)
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.
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 ()).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
- Release metrics: Make an imported metric what agents get.
See also
- Write metrics: Define one metric by hand.
- Save queries: Save one query by hand.