diff --git a/apps/backend/apps/admin/src/main.ts b/apps/backend/apps/admin/src/main.ts index ab005e49c9..5fdf55ef8c 100644 --- a/apps/backend/apps/admin/src/main.ts +++ b/apps/backend/apps/admin/src/main.ts @@ -9,8 +9,8 @@ const bootstrap = async () => { // otel instrumentation if (process.env.NODE_ENV == 'production') { if ( - process.env.OTEL_EXPORTER_OTLP_ENDPOINT == undefined || - process.env.OTEL_EXPORTER_OTLP_ENDPOINT == '' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL == undefined || + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL == '' ) { console.log('The exporter url is not defined') } else { diff --git a/apps/backend/apps/admin/src/metric.ts b/apps/backend/apps/admin/src/metric.ts index 4fdb8fcd29..1b7c974bb2 100644 --- a/apps/backend/apps/admin/src/metric.ts +++ b/apps/backend/apps/admin/src/metric.ts @@ -9,7 +9,8 @@ import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions' const startMetricsExporter = () => { const options = { - url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT + '/v1/metrics', // Grafana Agent Metric을 받는 url + url: + 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL + '/v1/metrics', // Grafana Agent Metric을 받는 url headers: {}, concurrencyLimit: 5 } diff --git a/apps/backend/apps/admin/src/tracer.ts b/apps/backend/apps/admin/src/tracer.ts index 27f5963268..a47a4daef6 100644 --- a/apps/backend/apps/admin/src/tracer.ts +++ b/apps/backend/apps/admin/src/tracer.ts @@ -15,7 +15,7 @@ class Tracer { // http://localhost:4318/v1/traces private exporter = new OTLPTraceExporter({ - url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT + '/v1/traces' + url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL + '/v1/traces' }) private provider = new BasicTracerProvider({ diff --git a/apps/backend/apps/client/src/main.ts b/apps/backend/apps/client/src/main.ts index e1de1e62d1..b79d5de7b3 100644 --- a/apps/backend/apps/client/src/main.ts +++ b/apps/backend/apps/client/src/main.ts @@ -11,8 +11,8 @@ const bootstrap = async () => { // otel instrumentation if (process.env.NODE_ENV == 'production') { if ( - process.env.OTEL_EXPORTER_OTLP_ENDPOINT == undefined || - process.env.OTEL_EXPORTER_OTLP_ENDPOINT == '' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL == undefined || + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL == '' ) { console.log('The exporter url is not defined') } else { diff --git a/apps/backend/apps/client/src/metric.ts b/apps/backend/apps/client/src/metric.ts index 052edf6076..4546335e52 100644 --- a/apps/backend/apps/client/src/metric.ts +++ b/apps/backend/apps/client/src/metric.ts @@ -9,7 +9,8 @@ import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions' const startMetricsExporter = () => { const options = { - url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT + '/v1/metrics', // Grafana Agent Metric을 받는 url + url: + 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL + '/v1/metrics', // Grafana Agent Metric을 받는 url headers: {}, concurrencyLimit: 5 } diff --git a/apps/backend/apps/client/src/tracer.ts b/apps/backend/apps/client/src/tracer.ts index e6b6aa7f61..b790d6b5d2 100644 --- a/apps/backend/apps/client/src/tracer.ts +++ b/apps/backend/apps/client/src/tracer.ts @@ -15,7 +15,7 @@ class Tracer { // http://localhost:4318/v1/traces private exporter = new OTLPTraceExporter({ - url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT + '/v1/traces' + url: 'http://' + process.env.OTEL_EXPORTER_OTLP_ENDPOINT_URL + '/v1/traces' }) private provider = new BasicTracerProvider({ diff --git a/apps/infra/modules/codedang-infra/backend/admin-task-definition.tftpl b/apps/infra/modules/codedang-infra/backend/admin-task-definition.tftpl index 03eff0d9aa..5cef4e4616 100644 --- a/apps/infra/modules/codedang-infra/backend/admin-task-definition.tftpl +++ b/apps/infra/modules/codedang-infra/backend/admin-task-definition.tftpl @@ -72,7 +72,7 @@ "value" : "${media_secret_key}" }, { - "name" : "OTEL_EXPORTER_OTLP_ENDPOINT", + "name" : "OTEL_EXPORTER_OTLP_ENDPOINT_URL", "value" : "${otel_endpoint}" } ], diff --git a/apps/infra/modules/codedang-infra/backend/client-task-definition.tftpl b/apps/infra/modules/codedang-infra/backend/client-task-definition.tftpl index 727ad1484f..176dea7381 100644 --- a/apps/infra/modules/codedang-infra/backend/client-task-definition.tftpl +++ b/apps/infra/modules/codedang-infra/backend/client-task-definition.tftpl @@ -92,7 +92,7 @@ "value": "${kakao_client_secret}" }, { - "name" : "OTEL_EXPORTER_OTLP_ENDPOINT", + "name" : "OTEL_EXPORTER_OTLP_ENDPOINT_URL", "value" : "${otel_endpoint}" } ], diff --git a/apps/infra/modules/codedang-infra/iris/task-definition.tftpl b/apps/infra/modules/codedang-infra/iris/task-definition.tftpl index 4739054ad0..7b821dbdfe 100644 --- a/apps/infra/modules/codedang-infra/iris/task-definition.tftpl +++ b/apps/infra/modules/codedang-infra/iris/task-definition.tftpl @@ -63,7 +63,7 @@ "value": "${redis_port}" }, { - "name" : "OTEL_EXPORTER_OTLP_ENDPOINT", + "name" : "OTEL_EXPORTER_OTLP_ENDPOINT_URL", "value" : "${otel_endpoint}" } ], diff --git a/apps/iris/main.go b/apps/iris/main.go index 8eaa8b99ae..c41797e79f 100644 --- a/apps/iris/main.go +++ b/apps/iris/main.go @@ -35,7 +35,7 @@ func main() { ctx := context.Background() cache := cache.NewCache(ctx) if env == "production" { - if utils.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT", "") != "" { + if utils.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT_URL", "") != "" { shutdown := observability.InitTracer(ctx) defer shutdown() observability.SetGlobalMeterProvider() @@ -43,7 +43,7 @@ func main() { observability.GetMemoryMeter(otel.Meter("memory-metrics")) observability.GetCPUMeter(otel.Meter("cpu-metrics"), 15*time.Second) } else { - logProvider.Log(logger.INFO, "Cannot find OTEL_EXPORTER_OTLP_ENDPOINT") + logProvider.Log(logger.INFO, "Cannot find OTEL_EXPORTER_OTLP_ENDPOINT_URL") } } else { logProvider.Log(logger.INFO, "Running in development mode") diff --git a/apps/iris/src/observability/metric.go b/apps/iris/src/observability/metric.go index e6e5e9a8db..4be2c48944 100644 --- a/apps/iris/src/observability/metric.go +++ b/apps/iris/src/observability/metric.go @@ -50,7 +50,7 @@ func newMetricResource() (*resource.Resource, error) { func newMeterProvider(res *resource.Resource, second time.Duration) (*sdkmetric.MeterProvider, error) { // Use OLTP Exporter for Grafana Agent (Recommended) - entryPoint := os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT") + entryPoint := os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT_URL") otlpExporter, err := otlpmetrichttp.New(context.Background(), otlpmetrichttp.WithEndpointURL("http://"+entryPoint+"/v1/metrics")) if err != nil { return nil, err diff --git a/apps/iris/src/observability/tracer.go b/apps/iris/src/observability/tracer.go index 8b8f82fa51..518bd0aab6 100644 --- a/apps/iris/src/observability/tracer.go +++ b/apps/iris/src/observability/tracer.go @@ -62,7 +62,7 @@ func newResource(ctx context.Context) (*resource.Resource, error) { } func newExporter(ctx context.Context) (*otlptrace.Exporter, error) { - oltpEndpoint := utils.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT", "") + oltpEndpoint := utils.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT_URL", "") exp, err := otlptracehttp.New(ctx, otlptracehttp.WithEndpoint(oltpEndpoint), otlptracehttp.WithInsecure()) if err != nil { return nil, err