Skip to content

Commit

Permalink
add grafana faro
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Mar 15, 2024
1 parent d0b0d54 commit 7af2e4c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/web/Jordnaer/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,33 @@
<link defer href="Jordnaer.Client.styles.css" rel="stylesheet" />

<HeadOutlet @rendermode="RenderModeForPage" />

<script>
(function () {
const script = document.createElement("script");
// Initialize the Web-SDK at the onLoad event of the script tag above so it will be called when the library is loaded.
script.onload = () => {
window.GrafanaFaroWebSdk.initializeFaro({
// Mandatory, the URL of the Grafana Cloud collector with embedded application key.
url: 'https://faro-collector-prod-eu-west-2.grafana.net/collect/bd7c8e7f952b79cf8fcebea0f94ea33a',
// Mandatory, the identification label(s) of your application
app: {
name: 'Mini Møder',
version: "1.0.0"
}
});
};
// Set the source of the script tag to the CDN
script.src =
"https://unpkg.com/@@grafana/faro-web-sdk@@^1.4.0/dist/bundle/faro-web-sdk.iife.js";
// Append the script tag to the head of the HTML page
document.head.appendChild(script);
})();
</script>
</head>

<body>
Expand Down

0 comments on commit 7af2e4c

Please sign in to comment.