diff --git a/.github/workflows/Component.BuildTest.yml b/.github/workflows/Component.BuildTest.yml index c21b9c4aa2e..f97c8b94f9b 100644 --- a/.github/workflows/Component.BuildTest.yml +++ b/.github/workflows/Component.BuildTest.yml @@ -68,13 +68,15 @@ jobs: run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage - name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} - uses: codecov/codecov-action@v3.1.5 + uses: codecov/codecov-action@v4 continue-on-error: true # Note: Don't fail for upload failures env: OS: ${{ matrix.os }} TFM: ${{ matrix.version }} + token: ${{ secrets.CODECOV_TOKEN }} with: file: TestResults/Cobertura.xml env_vars: OS,TFM flags: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} name: Code Coverage for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}] + codecov_yml_path: .github/codecov.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ee706de7d0a..9cf1fe874c0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: steps: - name: configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.3 + uses: al-cheb/configure-pagefile-action@v1.4 with: minimum-size: 8GB maximum-size: 32GB diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 1a4a8b38b8c..462832652d5 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: run markdownlint - uses: DavidAnson/markdownlint-cli2-action@v14.0.0 + uses: DavidAnson/markdownlint-cli2-action@v15.0.0 with: globs: | **/*.md diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md index dcd24114fd1..6978f0c8a38 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md @@ -21,6 +21,11 @@ experimental Logs Bridge API. ([#5268](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5268)) +* Updated `OtlpLogExporter` to set instrumentation scope name on the data model + from `LogRecord.Logger.Name` if `LogRecord.CategoryName` is `null`. This is + typically the case when using the experimental Logs Bridge API. + ([#5300](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5300)) + ## 1.7.0 Released 2023-Dec-08 diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs index 607f8fa5584..4851816017c 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpLogRecordTransformer.cs @@ -18,6 +18,8 @@ internal sealed class OtlpLogRecordTransformer { internal static readonly ConcurrentBag LogListPool = new(); + private const string DefaultScopeName = ""; + private readonly SdkLimitOptions sdkLimitOptions; private readonly ExperimentalOptions experimentalOptions; @@ -47,10 +49,11 @@ internal OtlpCollector.ExportLogsServiceRequest BuildExportRequest( var otlpLogRecord = this.ToOtlpLog(logRecord); if (otlpLogRecord != null) { - if (!logsByCategory.TryGetValue(logRecord.CategoryName, out var scopeLogs)) + var scopeName = logRecord.CategoryName ?? logRecord.Logger?.Name ?? DefaultScopeName; + if (!logsByCategory.TryGetValue(scopeName, out var scopeLogs)) { - scopeLogs = this.GetLogListFromPool(logRecord.CategoryName); - logsByCategory.Add(logRecord.CategoryName, scopeLogs); + scopeLogs = this.GetLogListFromPool(scopeName); + logsByCategory.Add(scopeName, scopeLogs); resourceLogs.ScopeLogs.Add(scopeLogs); } diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md index e0277436999..4bae2522a0c 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md @@ -11,6 +11,8 @@ * **Breaking Change**: Renamed `SqlClientInstrumentationOptions` to `SqlClientTraceInstrumentationOptions`. ([#5285](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5285)) +* **Breaking Change**: Stop emitting `db.statement_type` attribute. + ([#5301](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5301)) ## 1.6.0-beta.3 diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs index b16f6223aae..589ae603f7a 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs @@ -108,7 +108,6 @@ public override void OnEventWritten(string name, object payload) switch (commandType) { case CommandType.StoredProcedure: - activity.SetTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.StoredProcedure)); if (this.options.SetDbStatementForStoredProcedure) { activity.SetTag(SemanticConventions.AttributeDbStatement, (string)commandText); @@ -117,7 +116,6 @@ public override void OnEventWritten(string name, object payload) break; case CommandType.Text: - activity.SetTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.Text)); if (this.options.SetDbStatementForText) { activity.SetTag(SemanticConventions.AttributeDbStatement, (string)commandText); @@ -126,7 +124,6 @@ public override void OnEventWritten(string name, object payload) break; case CommandType.TableDirect: - activity.SetTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.TableDirect)); break; } } diff --git a/src/OpenTelemetry/Metrics/AggregatorStore.cs b/src/OpenTelemetry/Metrics/AggregatorStore.cs index 1ca4baa1114..e181a81fb82 100644 --- a/src/OpenTelemetry/Metrics/AggregatorStore.cs +++ b/src/OpenTelemetry/Metrics/AggregatorStore.cs @@ -12,7 +12,7 @@ namespace OpenTelemetry.Metrics; internal sealed class AggregatorStore { internal readonly bool OutputDelta; - internal readonly bool ShouldReclaimUnusedMetricPoints; + internal readonly bool OutputDeltaWithUnusedMetricPointReclaimEnabled; internal long DroppedMeasurements = 0; private static readonly string MetricPointCapHitFixMessage = "Consider opting in for the experimental SDK feature to emit all the throttled metrics under the overflow attribute by setting env variable OTEL_DOTNET_EXPERIMENTAL_METRICS_EMIT_OVERFLOW_ATTRIBUTE = true. You could also modify instrumentation to reduce the number of unique key/value pair combinations. Or use Views to drop unwanted tags. Or use MeterProviderBuilder.SetMaxMetricPointsPerMetricStream to set higher limit."; @@ -101,9 +101,9 @@ internal AggregatorStore( reservedMetricPointsCount++; } - this.ShouldReclaimUnusedMetricPoints = shouldReclaimUnusedMetricPoints; + this.OutputDeltaWithUnusedMetricPointReclaimEnabled = shouldReclaimUnusedMetricPoints && this.OutputDelta; - if (this.OutputDelta && shouldReclaimUnusedMetricPoints) + if (this.OutputDeltaWithUnusedMetricPointReclaimEnabled) { this.availableMetricPoints = new Queue(maxMetricPoints - reservedMetricPointsCount); @@ -158,17 +158,14 @@ internal void Update(double value, ReadOnlySpan> t internal int Snapshot() { this.batchSize = 0; - if (this.OutputDelta) + if (this.OutputDeltaWithUnusedMetricPointReclaimEnabled) { - if (this.ShouldReclaimUnusedMetricPoints) - { - this.SnapshotDeltaWithMetricPointReclaim(); - } - else - { - var indexSnapshot = Math.Min(this.metricPointIndex, this.maxMetricPoints - 1); - this.SnapshotDelta(indexSnapshot); - } + this.SnapshotDeltaWithMetricPointReclaim(); + } + else if (this.OutputDelta) + { + var indexSnapshot = Math.Min(this.metricPointIndex, this.maxMetricPoints - 1); + this.SnapshotDelta(indexSnapshot); } else { diff --git a/src/OpenTelemetry/Metrics/MetricPoint.cs b/src/OpenTelemetry/Metrics/MetricPoint.cs index d66ef5b309f..349afd51bd9 100644 --- a/src/OpenTelemetry/Metrics/MetricPoint.cs +++ b/src/OpenTelemetry/Metrics/MetricPoint.cs @@ -50,11 +50,7 @@ internal MetricPoint( { Debug.Assert(aggregatorStore != null, "AggregatorStore was null."); Debug.Assert(histogramExplicitBounds != null, "Histogram explicit Bounds was null."); - - if (aggregatorStore!.OutputDelta && aggregatorStore.ShouldReclaimUnusedMetricPoints) - { - Debug.Assert(lookupData != null, "LookupData was null."); - } + Debug.Assert(!aggregatorStore!.OutputDeltaWithUnusedMetricPointReclaimEnabled || lookupData != null, "LookupData was null."); this.aggType = aggType; this.Tags = new ReadOnlyTagCollection(tagKeysAndValues); @@ -445,7 +441,7 @@ internal void Update(long number) // by ignoring Zero points this.MetricPointStatus = MetricPointStatus.CollectPending; - if (this.aggregatorStore.OutputDelta) + if (this.aggregatorStore.OutputDeltaWithUnusedMetricPointReclaimEnabled) { Interlocked.Decrement(ref this.ReferenceCount); } @@ -570,7 +566,7 @@ internal void UpdateWithExemplar(long number, ReadOnlySpan(); + + using (var loggerProvider = Sdk.CreateLoggerProviderBuilder() + .AddInMemoryExporter(logRecords) + .Build()) + { + var logger = loggerProvider.GetLogger(loggerName); + + logger.EmitLog(new LogRecordData()); + } + + Assert.Single(logRecords); + + var otlpLogRecordTransformer = new OtlpLogRecordTransformer(DefaultSdkLimitOptions, new()); + + var batch = new Batch(new[] { logRecords[0] }, 1); + + var request = otlpLogRecordTransformer.BuildExportRequest( + new Proto.Resource.V1.Resource(), + batch); + + Assert.NotNull(request); + Assert.Single(request.ResourceLogs); + Assert.Single(request.ResourceLogs[0].ScopeLogs); + + Assert.Equal(expectedScopeName, request.ResourceLogs[0].ScopeLogs[0].Scope?.Name); + } + private static void RunVerifyEnvironmentVariablesTakenFromIConfigurationTest( string optionsName, Func, (IDisposable Container, ILoggerFactory LoggerFactory)> createLoggerFactoryFunc) diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md index d2c3b5b29f7..6582c757155 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net6.0.md @@ -8,9 +8,9 @@ | :green_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o `area:exists`, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | @@ -194,7 +194,7 @@ } ``` -## ConventionalRouting: Area using area:exists, default controller/action +## ConventionalRouting: Area using `area:exists`, default controller/action ```json { @@ -225,7 +225,7 @@ } ``` -## ConventionalRouting: Area using area:exists, non-default action +## ConventionalRouting: Area using `area:exists`, non-default action ```json { @@ -256,7 +256,7 @@ } ``` -## ConventionalRouting: Area w/o area:exists, default controller/action +## ConventionalRouting: Area w/o `area:exists`, default controller/action ```json { diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md index 35a0e331882..49d8224155c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net7.0.md @@ -8,9 +8,9 @@ | :green_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o `area:exists`, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | @@ -196,7 +196,7 @@ } ``` -## ConventionalRouting: Area using area:exists, default controller/action +## ConventionalRouting: Area using `area:exists`, default controller/action ```json { @@ -227,7 +227,7 @@ } ``` -## ConventionalRouting: Area using area:exists, non-default action +## ConventionalRouting: Area using `area:exists`, non-default action ```json { @@ -258,7 +258,7 @@ } ``` -## ConventionalRouting: Area w/o area:exists, default controller/action +## ConventionalRouting: Area w/o `area:exists`, default controller/action ```json { diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md index 3b712f73e20..40b63a1ca45 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md @@ -8,9 +8,9 @@ | :green_heart: | ConventionalRouting | [Not Found (404)](#conventionalrouting-not-found-404) | | :green_heart: | ConventionalRouting | [Route template with parameter constraint](#conventionalrouting-route-template-with-parameter-constraint) | | :green_heart: | ConventionalRouting | [Path that does not match parameter constraint](#conventionalrouting-path-that-does-not-match-parameter-constraint) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | -| :broken_heart: | ConventionalRouting | [Area using area:exists, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | -| :broken_heart: | ConventionalRouting | [Area w/o area:exists, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, default controller/action](#conventionalrouting-area-using-areaexists-default-controlleraction) | +| :broken_heart: | ConventionalRouting | [Area using `area:exists`, non-default action](#conventionalrouting-area-using-areaexists-non-default-action) | +| :broken_heart: | ConventionalRouting | [Area w/o `area:exists`, default controller/action](#conventionalrouting-area-wo-areaexists-default-controlleraction) | | :green_heart: | AttributeRouting | [Default action](#attributerouting-default-action) | | :green_heart: | AttributeRouting | [Action without parameter](#attributerouting-action-without-parameter) | | :green_heart: | AttributeRouting | [Action with parameter](#attributerouting-action-with-parameter) | @@ -24,6 +24,7 @@ | :green_heart: | MinimalApi | [Action with parameter](#minimalapi-action-with-parameter) | | :green_heart: | MinimalApi | [Action without parameter (MapGroup)](#minimalapi-action-without-parameter-mapgroup) | | :green_heart: | MinimalApi | [Action with parameter (MapGroup)](#minimalapi-action-with-parameter-mapgroup) | +| :green_heart: | ExceptionMiddleware | [Exception Handled by Exception Handler Middleware](#exceptionmiddleware-exception-handled-by-exception-handler-middleware) | ## ConventionalRouting: Root path @@ -195,7 +196,7 @@ } ``` -## ConventionalRouting: Area using area:exists, default controller/action +## ConventionalRouting: Area using `area:exists`, default controller/action ```json { @@ -226,7 +227,7 @@ } ``` -## ConventionalRouting: Area using area:exists, non-default action +## ConventionalRouting: Area using `area:exists`, non-default action ```json { @@ -257,7 +258,7 @@ } ``` -## ConventionalRouting: Area w/o area:exists, default controller/action +## ConventionalRouting: Area w/o `area:exists`, default controller/action ```json { @@ -632,3 +633,22 @@ } } ``` + +## ExceptionMiddleware: Exception Handled by Exception Handler Middleware + +```json +{ + "IdealHttpRoute": "/Exception", + "ActivityDisplayName": "GET /Exception", + "ActivityHttpRoute": "/Exception", + "MetricHttpRoute": "/Exception", + "RouteInfo": { + "HttpMethod": "GET", + "Path": "/Exception", + "RoutePattern.RawText": "/Exception", + "IRouteDiagnosticsMetadata.Route": "/Exception", + "HttpContext.GetRouteData()": {}, + "ActionDescriptor": null + } +} +``` diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json index 2d7dac9727a..2d1fa584ee8 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestCases.json @@ -54,7 +54,7 @@ "expectedHttpRoute": "" }, { - "name": "Area using area:exists, default controller/action", + "name": "Area using `area:exists`, default controller/action", "testApplicationScenario": "ConventionalRouting", "httpMethod": "GET", "path": "/MyArea", @@ -63,7 +63,7 @@ "expectedHttpRoute": "{area:exists}/ControllerForMyArea/Default/{id?}" }, { - "name": "Area using area:exists, non-default action", + "name": "Area using `area:exists`, non-default action", "testApplicationScenario": "ConventionalRouting", "httpMethod": "GET", "path": "/MyArea/ControllerForMyArea/NonDefault", @@ -72,7 +72,7 @@ "expectedHttpRoute": "{area:exists}/ControllerForMyArea/NonDefault/{id?}" }, { - "name": "Area w/o area:exists, default controller/action", + "name": "Area w/o `area:exists`, default controller/action", "testApplicationScenario": "ConventionalRouting", "httpMethod": "GET", "path": "/SomePrefix", diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs index d22093f0158..1b949e26740 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/RoutingTestFixture.cs @@ -71,7 +71,7 @@ private void GenerateReadme() { var result = this.testResults[i]; var emoji = result.TestCase.CurrentHttpRoute == null ? ":green_heart:" : ":broken_heart:"; - sb.AppendLine($"| {emoji} | {result.TestCase.TestApplicationScenario} | [{result.TestCase.Name}]({MakeAnchorTag(result.TestCase.TestApplicationScenario, result.TestCase.Name)}) |"); + sb.AppendLine($"| {emoji} | {result.TestCase.TestApplicationScenario} | [{result.TestCase.Name}]({GenerateLinkFragment(result.TestCase.TestApplicationScenario, result.TestCase.Name)}) |"); } for (var i = 0; i < this.testResults.Count; ++i) @@ -88,10 +88,12 @@ private void GenerateReadme() var readmeFileName = $"README.net{Environment.Version.Major}.0.md"; File.WriteAllText(Path.Combine("..", "..", "..", "RouteTests", readmeFileName), sb.ToString()); - static string MakeAnchorTag(TestApplicationScenario scenario, string name) + // Generates a link fragment that should comply with markdownlint rule MD051 + // https://github.com/DavidAnson/markdownlint/blob/main/doc/md051.md + static string GenerateLinkFragment(TestApplicationScenario scenario, string name) { var chars = name.ToCharArray() - .Where(c => !char.IsPunctuation(c) || c == '-') + .Where(c => (!char.IsPunctuation(c) && c != '`') || c == '-') .Select(c => c switch { '-' => '-', diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs index b900fd8bf19..5394c75a0fb 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs @@ -246,8 +246,6 @@ private static void VerifyActivityData( Assert.Equal("master", activity.GetTagValue(SemanticConventions.AttributeDbName)); - // "db.statement_type" is never set by the SqlEventSource instrumentation - Assert.Null(activity.GetTagValue(SpanAttributeConstants.DatabaseStatementTypeKey)); if (captureText) { Assert.Equal(commandText, activity.GetTagValue(SemanticConventions.AttributeDbStatement));