Skip to content

Commit c7cc168

Browse files
authored
Add client web vitals telemetry forwarding (#83)
* feat: collect web vitals telemetry * refactor: switch frontend build to server runtime
1 parent bc14c28 commit c7cc168

File tree

6 files changed

+1029
-11
lines changed

6 files changed

+1029
-11
lines changed

frontend/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ docker compose --env-file .env.development -f docker-compose.dev.yml up frontend
2828
## Adding New Pages
2929

3030
To add a new page, create a new directory in src/app with a page.tsx file, following the Next.js App Router conventions.
31+
32+
## Observability Configuration
33+
34+
Web Vitals are collected in the browser and forwarded to an OpenTelemetry collector from the `/api/otel/webvital` route. Configure the collector target using the following environment variables when running the frontend:
35+
36+
- `OTEL_COLLECTOR_URL` – full URL to the collector (e.g. `http://otel-collector:4318`).
37+
- or `OTEL_COLLECTOR_HOST` and `OTEL_COLLECTOR_PORT` – host and port that will be combined into `http(s)://HOST:PORT/v1/traces`.
38+
- `OTEL_COLLECTOR_PROTOCOL` – optional protocol override (`http` by default) when using host/port variables.
39+
- `OTEL_SERVICE_NAME` – optional service name reported to the collector (defaults to `paform-frontend`).

frontend/next.config.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
output: 'export',
43
basePath: '',
54
images: {
65
unoptimized: true,
@@ -25,9 +24,4 @@ const nextConfig = {
2524
},
2625
};
2726

28-
// Handle rewrites differently for static export
29-
if (process.env.NODE_ENV === 'production') {
30-
delete nextConfig.rewrites;
31-
}
32-
3327
export default nextConfig;

0 commit comments

Comments
 (0)