Skip to content

Commit

Permalink
test nais.js
Browse files Browse the repository at this point in the history
  • Loading branch information
andersrognstad committed Feb 23, 2024
1 parent c2b1cce commit 32cf13c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .nais/naiserator-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ spec:
claims:
extra:
- "NAVident"
frontend:
generatedConfig:
mountPath: /usr/share/nginx/html/src/nais.js
ingresses:
- "https://finnfastlege.intern.dev.nav.no"
3 changes: 3 additions & 0 deletions .nais/naiserator-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ spec:
claims:
extra:
- "NAVident"
frontend:
generatedConfig:
mountPath: /usr/share/nginx/html/src/nais.js
ingresses:
- "https://finnfastlege.intern.nav.no"
5 changes: 4 additions & 1 deletion src/faro.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getWebInstrumentations, initializeFaro } from "@grafana/faro-react";
import { TracingInstrumentation } from "@grafana/faro-web-tracing";
import { erLokal, erPreProd } from "@/utils/miljoUtil";
import nais from "./nais.js";

const getUrl = () => {
if (erLokal()) {
Expand All @@ -12,7 +13,8 @@ const getUrl = () => {
}
};

export const initFaro = () =>
export const initFaro = () => {
console.log("faro nais:", nais);
initializeFaro({
url: getUrl(),
app: { name: "finnfastlege" },
Expand All @@ -22,3 +24,4 @@ export const initFaro = () =>
new TracingInstrumentation(),
],
});
};
7 changes: 7 additions & 0 deletions src/nais.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
telemetryCollectorURL: "http://localhost:12347/collect",
app: {
name: "finnfastlege",
version: "dev",
},
};
2 changes: 1 addition & 1 deletion webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const commonConfig: Configuration = {
{
test: /\.(js|ts|tsx)$/,
use: { loader: "babel-loader" },
exclude: /node_modules/,
exclude: ["./nais.js", /node_modules/],
},
{
test: /\.(css|sass)$/,
Expand Down

0 comments on commit 32cf13c

Please sign in to comment.