diff --git a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Extensions/ServiceExtensions.cs b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Extensions/ServiceExtensions.cs index bf2eafd..028faa6 100644 --- a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Extensions/ServiceExtensions.cs +++ b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Extensions/ServiceExtensions.cs @@ -45,8 +45,10 @@ public static IServiceCollection AddObservable(this IServiceCollection services, IEnumerable? activitySources = default, IEnumerable? blazorRouteAssemblies = default, Action? traceInstrumentConfig = default, - Action? metricInstrumentConfig = default, - Action? logInstrumentConfig = default + Action? metricInstrumentConfig = default +#if !OTEL_LEGACY + , Action? logInstrumentConfig = default +#endif ) { ArgumentNullException.ThrowIfNull(option); diff --git a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj index b6d3005..78e41ac 100644 --- a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj +++ b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Masa.Contrib.StackSdks.Tsc.OpenTelemetry.csproj @@ -6,7 +6,25 @@ false - + + + $(DefineConstants);OTEL_LEGACY + + + + + + + + + + + + + + + @@ -26,4 +44,3 @@ - diff --git a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs index 30fdbef..8e692cc 100644 --- a/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs +++ b/src/Contrib/Masa.Contrib.StackSdks.Tsc.OpenTelemetry/Traceing/OpenTelemetryInstrumentationOptions.cs @@ -61,7 +61,9 @@ private static void InitializeHeaders(IConfiguration? configuration) /// public Action EntityFrameworkInstrumentationOptions { get; set; } = options => { - +#if OTEL_LEGACY + options.SetDbStatementForText = true; +#endif }; public Action ElasticsearchClientInstrumentationOptions { get; set; } = options =>