From 998fc9d75eceb892552339d1edd74f64522f1a3d Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Mon, 16 Dec 2024 15:04:44 +0100 Subject: [PATCH] env variables --- .env | 5 +++++ docker-compose.yml | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 8300930d6..bb0b34a8c 100644 --- a/.env +++ b/.env @@ -5,3 +5,8 @@ POSTGRES_DB=dialogporten DB_CONNECTION_STRING=Server=dialogporten-postgres;Port=5432;Database=${POSTGRES_DB};User ID=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}; COMPOSE_PROJECT_NAME=digdir + +# OTEL +OTEL_NAMESPACE=dialogporten-local +OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318 +OTEL_EXPORTER_OTLP_PROTOCOL=http \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 87b510dff..0063396cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,12 +35,11 @@ services: - Serilog__MinimumLevel__Default=Debug - ASPNETCORE_URLS=http://+:8080 - ASPNETCORE_ENVIRONMENT=Development - - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318 - - OTEL_EXPORTER_OTLP_PROTOCOL=http + - OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} + - OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL} - OTEL_SERVICE_NAME=dialogporten-webapi - - OTEL_RESOURCE_ATTRIBUTES=service.instance.id=dialogporten-webapi,service.namespace=dialogporten-local - # Add these for debugging - - OTEL_LOG_LEVEL=debug + - OTEL_RESOURCE_ATTRIBUTES=service.instance.id=dialogporten-webapi,service.namespace=${OTEL_NAMESPACE} + - OTEL_LOG_LEVEL=${OTEL_LOG_LEVEL} volumes: - ./.aspnet/https:/https @@ -77,9 +76,9 @@ services: - Serilog__WriteTo__0__Name=Console - Serilog__MinimumLevel__Default=Debug - ASPNETCORE_ENVIRONMENT=Development - - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318 - - OTEL_EXPORTER_OTLP_PROTOCOL=http + - OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} + - OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL} - OTEL_SERVICE_NAME=dialogporten-graphql - - OTEL_RESOURCE_ATTRIBUTES=service.instance.id=dialogporten-graphql,service.namespace=dialogporten-local + - OTEL_RESOURCE_ATTRIBUTES=service.instance.id=dialogporten-graphql,service.namespace=${OTEL_NAMESPACE} volumes: - ./.aspnet/https:/https