diff --git a/.ghcr.env b/.ghcr.env
new file mode 120000
index 0000000000..2eea525d88
--- /dev/null
+++ b/.ghcr.env
@@ -0,0 +1 @@
+.env
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 8327d1d2cc..d23e001c9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,7 +35,6 @@ vendor/
composer.lock
.venv
.dockerhub.env
-.ghcr.env
src/frontend/cypress/videos
src/frontend/cypress/screenshots
diff --git a/src/cartservice/src/Program.cs b/src/cartservice/src/Program.cs
index 743fe542b9..0f27344f4d 100644
--- a/src/cartservice/src/Program.cs
+++ b/src/cartservice/src/Program.cs
@@ -14,8 +14,6 @@
using OpenTelemetry.Instrumentation.StackExchangeRedis;
using OpenTelemetry.Logs;
using OpenTelemetry.Metrics;
-using OpenTelemetry.ResourceDetectors.Container;
-using OpenTelemetry.ResourceDetectors.Host;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Serilog;
@@ -63,6 +61,8 @@
var builder = WebApplication.CreateBuilder(args);
string valkeyAddress = builder.Configuration["VALKEY_ADDR"];
+string collectorAddress = builder.Configuration["OTEL_COLLECTOR_NAME"];
+string serviceName = builder.Configuration["OTEL_SERVICE_NAME"];
if (string.IsNullOrEmpty(valkeyAddress))
{
Console.WriteLine("VALKEY_ADDR environment variable is required.");
@@ -73,6 +73,11 @@
Console.WriteLine("OTEL_COLLECTOR_NAME environment variable is required.");
Environment.Exit(1);
}
+if (string.IsNullOrEmpty(serviceName))
+{
+ serviceName = "CartService";
+ Console.WriteLine("OTEL_SERVICE_NAME environment variable is not set. Defaulting to service name \'CartService\'.");
+}
//string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] trace_id=\"{trace_id}\" span_id=\"{span_id}\" service.name=\"{service_name}\" service.version=\"{service_version}\" deployment.environment=\"{deployment_environment}\"{NewLine}{Message:lj}{NewLine}{Exception}";
diff --git a/src/cartservice/src/cartservice.csproj b/src/cartservice/src/cartservice.csproj
index 42baf0f3a2..5a07cb1911 100644
--- a/src/cartservice/src/cartservice.csproj
+++ b/src/cartservice/src/cartservice.csproj
@@ -33,13 +33,15 @@
+