Skip to content

Commit ba0ffac

Browse files
committed
Set the OTEL_EXPORTER_OTLP_ENDPOINT env var on dev workers
1 parent e55ca02 commit ba0ffac

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ COORDINATOR_SECRET=coordinator-secret # generate the actual secret with `openssl
5858
# DEPLOY_REGISTRY_HOST=${APP_ORIGIN} # This is the host that the deploy CLI will use to push images to the registry
5959
# CONTAINER_REGISTRY_ORIGIN=<Container registry origin e.g. https://registry.digitalocean.com>
6060
# CONTAINER_REGISTRY_USERNAME=<Container registry username e.g. Digital ocean email address>
61-
# CONTAINER_REGISTRY_PASSWORD=<Container registry password e.g. Digital ocean PAT>
61+
# CONTAINER_REGISTRY_PASSWORD=<Container registry password e.g. Digital ocean PAT>
62+
# DEV_OTEL_EXPORTER_OTLP_ENDPOINT="http://0.0.0.0:4318"

apps/webapp/app/env.server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const EnvironmentSchema = z.object({
8282
CONTAINER_REGISTRY_USERNAME: z.string().optional(),
8383
CONTAINER_REGISTRY_PASSWORD: z.string().optional(),
8484
DEPLOY_REGISTRY_HOST: z.string().optional(),
85+
DEV_OTEL_EXPORTER_OTLP_ENDPOINT: z.string().optional(),
8586
});
8687

8788
export type Environment = z.infer<typeof EnvironmentSchema>;

apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function parseSecretKey(key: string) {
3030
const SecretValue = z.object({ secret: z.string() });
3131

3232
export class EnvironmentVariablesRepository implements Repository {
33-
constructor(private prismaClient: PrismaClient = prisma) {}
33+
constructor(private prismaClient: PrismaClient = prisma) { }
3434

3535
async create(
3636
projectId: string,
@@ -415,7 +415,12 @@ export class EnvironmentVariablesRepository implements Repository {
415415
}
416416

417417
if (environment.type === "DEVELOPMENT") {
418-
return [];
418+
return [
419+
{
420+
key: "OTEL_EXPORTER_OTLP_ENDPOINT",
421+
value: env.DEV_OTEL_EXPORTER_OTLP_ENDPOINT ?? env.APP_ORIGIN,
422+
}
423+
];
419424
}
420425

421426
return [

0 commit comments

Comments
 (0)