mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
Compare commits
12 Commits
feature/re
...
shubham/fo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f450dfaff | ||
|
|
6f4a84992f | ||
|
|
a5d236532f | ||
|
|
ae8c10944b | ||
|
|
5f12ebe54b | ||
|
|
4362c95581 | ||
|
|
4c496bace4 | ||
|
|
da61b37d2d | ||
|
|
d31802a2fe | ||
|
|
95fa4092ee | ||
|
|
b6d7ae1af5 | ||
|
|
b0bbd4a131 |
@@ -165,3 +165,6 @@ ENTERPRISE_LICENSE_KEY=
|
||||
|
||||
# Ignore Rate Limiting across the Formbricks app
|
||||
# RATE_LIMITING_DISABLED=1
|
||||
|
||||
# OpenTelemetry URL for tracing
|
||||
# OPENTELEMETRY_LISTENER_URL=http://localhost:4318/v1/traces
|
||||
|
||||
1
.github/workflows/kamal.yml
vendored
1
.github/workflows/kamal.yml
vendored
@@ -68,6 +68,7 @@ jobs:
|
||||
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
|
||||
S3_REGION: ${{ vars.S3_REGION }}
|
||||
S3_BUCKET_NAME: ${{ vars.S3_BUCKET_NAME }}
|
||||
OPENTELEMETRY_LISTENER_URL: ${{ vars.OPENTELEMETRY_LISTENER_URL }}
|
||||
KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }}
|
||||
|
||||
steps:
|
||||
|
||||
@@ -183,6 +183,7 @@ These variables can be provided at the runtime i.e. in your docker-compose file.
|
||||
| OIDC_CLIENT_SECRET | Secret for Custom OpenID Connect Provider | optional (required if OIDC auth is enabled) | |
|
||||
| OIDC_ISSUER | Issuer URL for Custom OpenID Connect Provider (should have `.well-known` configured at this) | optional (required if OIDC auth is enabled) | |
|
||||
| OIDC_SIGNING_ALGORITHM | Signing Algorithm for Custom OpenID Connect Provider | optional | `RS256` |
|
||||
| OPENTELEMETRY_LISTENER_URL | URL for OpenTelemetry listener inside Formbricks. | optional | | |
|
||||
|
||||
## Build-time Variables
|
||||
|
||||
|
||||
27
apps/web/instrumentation.node.ts
Normal file
27
apps/web/instrumentation.node.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
|
||||
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
||||
import { Resource } from "@opentelemetry/resources";
|
||||
import { NodeSDK } from "@opentelemetry/sdk-node";
|
||||
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
||||
import { SEMRESATTRS_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
||||
|
||||
export function startInstrumentationForNode(url: string) {
|
||||
try {
|
||||
const exporter = new OTLPTraceExporter({
|
||||
url,
|
||||
});
|
||||
|
||||
const sdk = new NodeSDK({
|
||||
resource: new Resource({
|
||||
[SEMRESATTRS_SERVICE_NAME]: "Formbricks",
|
||||
}),
|
||||
traceExporter: exporter,
|
||||
spanProcessor: new SimpleSpanProcessor(exporter),
|
||||
instrumentations: [getNodeAutoInstrumentations()],
|
||||
});
|
||||
|
||||
sdk.start();
|
||||
} catch (err) {
|
||||
console.error("Unable to setup Telemetry:", err);
|
||||
}
|
||||
}
|
||||
9
apps/web/instrumentation.ts
Normal file
9
apps/web/instrumentation.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { env } from "@formbricks/lib/env";
|
||||
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === "nodejs" && env.OPENTELEMETRY_LISTENER_URL) {
|
||||
const { startInstrumentationForNode } = await import("./instrumentation.node");
|
||||
|
||||
startInstrumentationForNode(env.OPENTELEMETRY_LISTENER_URL);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ const nextConfig = {
|
||||
output: "standalone",
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["@aws-sdk"],
|
||||
instrumentationHook: true,
|
||||
},
|
||||
transpilePackages: ["@formbricks/database", "@formbricks/ee", "@formbricks/ui", "@formbricks/lib"],
|
||||
images: {
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
"@formbricks/ui": "workspace:*",
|
||||
"@headlessui/react": "^1.7.18",
|
||||
"@json2csv/node": "^7.0.6",
|
||||
"@opentelemetry/auto-instrumentations-node": "^0.43.0",
|
||||
"@opentelemetry/exporter-trace-otlp-http": "^0.49.1",
|
||||
"@opentelemetry/resources": "^1.22.0",
|
||||
"@opentelemetry/sdk-node": "^0.49.1",
|
||||
"@opentelemetry/semantic-conventions": "^1.22.0",
|
||||
"@paralleldrive/cuid2": "^2.2.2",
|
||||
"@radix-ui/react-collapsible": "^1.0.3",
|
||||
"@react-email/components": "^0.0.15",
|
||||
|
||||
@@ -76,6 +76,7 @@ env:
|
||||
- NEXT_PUBLIC_FORMBRICKS_API_HOST
|
||||
- NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID
|
||||
- NEXT_PUBLIC_FORMBRICKS_ONBOARDING_SURVEY_ID
|
||||
- OPENTELEMETRY_LISTENER_URL
|
||||
- NEXT_PUBLIC_SENTRY_DSN
|
||||
- CLOUDFLARE_EMAIL
|
||||
- CLOUDFLARE_DNS_API_TOKEN
|
||||
|
||||
@@ -50,6 +50,7 @@ export const env = createEnv({
|
||||
OIDC_DISPLAY_NAME: z.string().optional(),
|
||||
OIDC_ISSUER: z.string().optional(),
|
||||
OIDC_SIGNING_ALGORITHM: z.string().optional(),
|
||||
OPENTELEMETRY_LISTENER_URL: z.string().optional(),
|
||||
ONBOARDING_DISABLED: z.string().optional(),
|
||||
PASSWORD_RESET_DISABLED: z.enum(["1", "0"]).optional(),
|
||||
PRIVACY_URL: z
|
||||
@@ -145,6 +146,7 @@ export const env = createEnv({
|
||||
NEXT_PUBLIC_POSTHOG_API_HOST: process.env.NEXT_PUBLIC_POSTHOG_API_HOST,
|
||||
NEXT_PUBLIC_POSTHOG_API_KEY: process.env.NEXT_PUBLIC_POSTHOG_API_KEY,
|
||||
NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
OPENTELEMETRY_LISTENER_URL: process.env.OPENTELEMETRY_LISTENER_URL,
|
||||
NOTION_OAUTH_CLIENT_ID: process.env.NOTION_OAUTH_CLIENT_ID,
|
||||
NOTION_OAUTH_CLIENT_SECRET: process.env.NOTION_OAUTH_CLIENT_SECRET,
|
||||
OIDC_CLIENT_ID: process.env.OIDC_CLIENT_ID,
|
||||
|
||||
1360
pnpm-lock.yaml
generated
1360
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -104,6 +104,8 @@
|
||||
"NEXT_PUBLIC_FORMBRICKS_COM_API_HOST",
|
||||
"NEXT_PUBLIC_FORMBRICKS_COM_ENVIRONMENT_ID",
|
||||
"NEXT_PUBLIC_FORMBRICKS_COM_DOCS_FEEDBACK_SURVEY_ID",
|
||||
"OPENTELEMETRY_LISTENER_URL",
|
||||
"NEXT_RUNTIME",
|
||||
"NEXTAUTH_SECRET",
|
||||
"NEXTAUTH_URL",
|
||||
"NODE_ENV",
|
||||
|
||||
Reference in New Issue
Block a user