-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* legger på grafana faro for web vitals * fjerner browser env url'er som kun skal trenges serverside * legger til codeowners
- Loading branch information
Showing
10 changed files
with
225 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. | ||
* @navikt/teamdagpenger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { type Faro, getWebInstrumentations, initializeFaro } from "@grafana/faro-web-sdk"; | ||
import { getEnv } from "~/utils/env.utils"; | ||
let faro: Faro | null = null; | ||
|
||
export function initInstrumentation(): void { | ||
if (typeof window === "undefined" || faro !== null) return; | ||
|
||
getFaro(); | ||
} | ||
|
||
export function getFaro(): Faro | null { | ||
if (faro != null) return faro; | ||
faro = initializeFaro({ | ||
url: getEnv("FARO_URL"), // required, see below | ||
app: { | ||
name: "dp-rapportering-frontend", // required | ||
version: "0.1", // optional; useful in Grafana to get diff between versions | ||
}, | ||
instrumentations: [ | ||
...getWebInstrumentations({ | ||
captureConsole: true, | ||
}), | ||
], | ||
}); | ||
return faro; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters