Skip to content

Commit

Permalink
Link to metrics in Data Catalog (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iinh authored Apr 18, 2024
1 parent bb46ec4 commit 6709c9f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/pages/MetricDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
updateURLState,
updateBreadcrumbs,
} from "../state/stores";
import { getBigQueryURL, getMetricSearchURL } from "../state/urls";
import {
getBigQueryURL,
getDataCatalogMetricURL,
getMetricSearchURL,
} from "../state/urls";
import { getAppBreadcrumbs } from "./AppDetail.svelte";
import { isExpired, isRemoved, isRecent } from "../state/items";
Expand Down Expand Up @@ -528,6 +532,25 @@
</div>
</td>
</tr>
<tr>
<td>
Data Catalog
<HelpHoverable
content={"View this metric in Mozilla's instance of DataHub"}
/>
</td>
<td>
<AuthenticatedLink
href={getDataCatalogMetricURL(
selectedAppVariant.id,
selectedPingVariant.id,
selectedAppVariant.etl.bigquery_column_name
)}
>
{selectedAppVariant.etl.bigquery_column_name}
</AuthenticatedLink>
</td>
</tr>
<tr>
<td>
STMO
Expand Down
8 changes: 8 additions & 0 deletions src/state/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ export function getBigQueryURL(appName, appId, pingName, metricName) {
export function getMetricSearchURL(app, search) {
return `/apps/${app}?search=${search}`;
}

export function getDataCatalogMetricURL(appId, pingId, bigQueryColumn) {
const DATA_CATALOG_URL = "https://mozilla.acryl.io";
return `${DATA_CATALOG_URL}/dataset/urn:li:dataset:(urn:li:dataPlatform:bigquery,moz-fx-data-shared-prod.${appId.replace(
/\./g,
"_"
)}.${pingId},PROD)/Lineage?column=${bigQueryColumn}`;
}

0 comments on commit 6709c9f

Please sign in to comment.