Skip to content

Commit 32f6cf9

Browse files
LinhIinh
Linh
authored andcommitted
Link to metrics in Data Catalog
1 parent bb46ec4 commit 32f6cf9

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/pages/MetricDetail.svelte

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
updateURLState,
3333
updateBreadcrumbs,
3434
} from "../state/stores";
35-
import { getBigQueryURL, getMetricSearchURL } from "../state/urls";
35+
import {
36+
getBigQueryURL,
37+
getDataCatalogMetricURL,
38+
getMetricSearchURL,
39+
} from "../state/urls";
3640
import { getAppBreadcrumbs } from "./AppDetail.svelte";
3741
3842
import { isExpired, isRemoved, isRecent } from "../state/items";
@@ -528,6 +532,25 @@
528532
</div>
529533
</td>
530534
</tr>
535+
<tr>
536+
<td>
537+
Data Catalog
538+
<HelpHoverable
539+
content={"View this metric in Mozilla's instance of DataHub"}
540+
/>
541+
</td>
542+
<td>
543+
<AuthenticatedLink
544+
href={getDataCatalogMetricURL(
545+
selectedAppVariant.id,
546+
selectedPingVariant.id,
547+
selectedAppVariant.etl.bigquery_column_name
548+
)}
549+
>
550+
{selectedAppVariant.etl.bigquery_column_name}
551+
</AuthenticatedLink>
552+
</td>
553+
</tr>
531554
<tr>
532555
<td>
533556
STMO

src/state/urls.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ export function getBigQueryURL(appName, appId, pingName, metricName) {
2323
export function getMetricSearchURL(app, search) {
2424
return `/apps/${app}?search=${search}`;
2525
}
26+
27+
export function getDataCatalogMetricURL(appId, pingId, bigQueryColumn) {
28+
const DATA_CATALOG_URL = "https://mozilla.acryl.io";
29+
return `${DATA_CATALOG_URL}/dataset/urn:li:dataset:(urn:li:dataPlatform:bigquery,moz-fx-data-shared-prod.${appId.replace(
30+
/\./g,
31+
"_"
32+
)}.${pingId},PROD)/Lineage?column=${bigQueryColumn}`;
33+
}

0 commit comments

Comments
 (0)