feat: add instrumentation

This commit is contained in:
Arvid Norlin
2024-07-01 11:02:19 +02:00
parent 9b4fde334f
commit edc2216d83
5 changed files with 382 additions and 19 deletions

9
env/server.ts vendored
View File

@@ -9,6 +9,9 @@ export const env = createEnv({
*/
isServer: typeof window === "undefined" || "Deno" in window,
server: {
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: z.string(),
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: z.string(),
APPLICATION_INSIGHTS_CONNECTION_STRING: z.string(),
ADOBE_SCRIPT_SRC: z.string().optional(),
API_BASEURL: z.string(),
BUILD_ID: z.string().default("64rYXBu8o2eHp0Jf"),
@@ -58,6 +61,12 @@ export const env = createEnv({
},
emptyStringAsUndefined: true,
runtimeEnv: {
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:
process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:
process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL,
APPLICATION_INSIGHTS_CONNECTION_STRING:
process.env.APPLICATION_INSIGHTS_CONNECTION_STRING,
ADOBE_SCRIPT_SRC: process.env.ADOBE_SCRIPT_SRC,
API_BASEURL: process.env.API_BASEURL,
BUILD_ID: process.env.BUILD_ID,