mirror of
https://github.com/bitwarden/server.git
synced 2026-02-01 14:43:10 +08:00
fix(billing): update otlexporter duplicate call
This commit is contained in:
@@ -3,10 +3,6 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenTelemetry;
|
||||
using OpenTelemetry.Metrics;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
namespace Bit.ServiceDefaults;
|
||||
|
||||
@@ -189,7 +185,15 @@ public static class Extensions
|
||||
var useOtlpExporter = !string.IsNullOrWhiteSpace(context.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
|
||||
if (useOtlpExporter)
|
||||
{
|
||||
services.AddOpenTelemetry().UseOtlpExporter();
|
||||
// Check if OTLP exporter is already configured
|
||||
var otlpExporterAlreadyRegistered = services.Any(sd =>
|
||||
sd.ServiceType.FullName?.Contains("OtlpExporter") == true ||
|
||||
sd.ImplementationType?.FullName?.Contains("OtlpExporter") == true);
|
||||
|
||||
if (!otlpExporterAlreadyRegistered)
|
||||
{
|
||||
services.AddOpenTelemetry().UseOtlpExporter();
|
||||
}
|
||||
}
|
||||
});
|
||||
return hostBuilder;
|
||||
|
||||
@@ -379,6 +379,10 @@ Global
|
||||
{FFB09376-595B-6F93-36F0-70CAE90AFECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FFB09376-595B-6F93-36F0-70CAE90AFECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FFB09376-595B-6F93-36F0-70CAE90AFECB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B4CC25D0-BD09-459E-9885-DF9A56E304F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B4CC25D0-BD09-459E-9885-DF9A56E304F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7D6F3351-9CA6-4B35-956F-1EE346330A41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7D6F3351-9CA6-4B35-956F-1EE346330A41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user