diff --git a/Backend/Otel/BackendActivitySource.cs b/Backend/Otel/BackendActivitySource.cs index f6a74df9db..0ac9a91522 100644 --- a/Backend/Otel/BackendActivitySource.cs +++ b/Backend/Otel/BackendActivitySource.cs @@ -6,6 +6,6 @@ public class BackendActivitySource { public static ActivitySource Get() { - return new ActivitySource(OtelKernel.ServiceName); + return new ActivitySource("service"); } } diff --git a/Backend/Otel/OtelKernel.cs b/Backend/Otel/OtelKernel.cs index f8fa000a70..d16a6a68c4 100644 --- a/Backend/Otel/OtelKernel.cs +++ b/Backend/Otel/OtelKernel.cs @@ -1,7 +1,7 @@ // using System; using System.Diagnostics; -using System.Diagnostics.Metrics; +// using System.Diagnostics.Metrics; // using System.Net.Http; // using System.Net.Http.Json; using System.Security.Claims; @@ -20,7 +20,7 @@ namespace BackendFramework.Otel public static class OtelKernel { - public const string ServiceName = "Backend-Otel"; + // public const string ServiceName = "Backend-Otel"; // private readonly LocationCache _locationCache; // public OtelKernel(LocationCache locationCache, IServiceCollection serviceCollection) @@ -31,11 +31,11 @@ public static class OtelKernel public static void AddOpenTelemetryInstrumentation(this IServiceCollection services) { - var appResourceBuilder = ResourceBuilder.CreateDefault().AddService(ServiceName); + var appResourceBuilder = ResourceBuilder.CreateDefault(); // todo: include version services.AddOpenTelemetry().WithTracing(tracerProviderBuilder => tracerProviderBuilder .SetResourceBuilder(appResourceBuilder) - .AddSource(ServiceName) + // .AddSource(ServiceName) .AddProcessor() .AddAspNetCoreInstrumentation(options => { @@ -119,7 +119,7 @@ public static void AddOpenTelemetryInstrumentation(this IServiceCollection servi // .AddOtlpExporter() // ); - var meter = new Meter(ServiceName); + // var meter = new Meter(ServiceName); } diff --git a/Backend/Properties/launchSettings.json b/Backend/Properties/launchSettings.json index c443066138..c859227ddc 100644 --- a/Backend/Properties/launchSettings.json +++ b/Backend/Properties/launchSettings.json @@ -28,7 +28,6 @@ "environmentVariables": { "Key": "Value", "ASPNETCORE_ENVIRONMENT": "Development", - "OTEL_SERVICE_NAME": "Backend-Otel", "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc", "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317", "COMBINE_CAPTCHA_REQUIRED": "true", diff --git a/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml b/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml index 84cd9ff631..b1a82dc7a7 100644 --- a/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml +++ b/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml @@ -30,7 +30,8 @@ spec: imagePullPolicy: {{ .Values.global.imagePullPolicy }} env: - name: OTEL_SERVICE_NAME - value: "Otel-k8s-simple-deployment" + value: {{ .Values.global.serverName }} + # value: "Otel-k8s-simple-deployment" - name: OTEL_EXPORTER_OTLP_PROTOCOL value: "http/protobuf" - name: OTEL_EXPORTER_OTLP_ENDPOINT