Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust database span naming convention. #1502

Merged
merged 5 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Expose ConfigureAppFrame as a public static function. ([#1493](https://github.com/getsentry/sentry-dotnet/pull/1493))

### Fixes

- Adjust database span names by replacing `_` to `.`. `db.query_compiler` becomes `db.query.compile`. ([#1502](https://github.com/getsentry/sentry-dotnet/pull/1502))

## 3.14.1

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void OnNext(KeyValuePair<string, object?> value)
//Query compiler Span
if (value.Key == EFQueryStartCompiling || value.Key == EFQueryCompiling)
{
AddSpan(SentryEFSpanType.QueryCompiler, "db.query_compiler", FilterNewLineValue(value.Value));
AddSpan(SentryEFSpanType.QueryCompiler, "db.query.compile", FilterNewLineValue(value.Value));
}
else if (value.Key == EFQueryCompiled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class SentryQueryPerformanceListener : IDbCommandInterceptor
internal const string SentryUserStateKey = "SentrySpanRef";
internal const string DbReaderKey = "db.query";
internal const string DbNonQueryKey = "db.execute";
internal const string DbScalarKey = "db.query-scalar";
internal const string DbScalarKey = "db.query.scalar";

private SentryOptions _options { get; }
private IHub _hub { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void EfCoreIntegration_RunSynchronousQueryWithIssue_TransactionWithSpans(
Assert.Single(spans); //1 command
#else
Assert.Equal(2, spans.Count); //1 query compiler, 1 command
Assert.Single(spans.Where(s => s.Status == SpanStatus.Ok && s.Operation == "db.query_compiler"));
Assert.Single(spans.Where(s => s.Status == SpanStatus.Ok && s.Operation == "db.query.compile"));
#endif
Assert.Single(spans.Where(s => s.Status == SpanStatus.InternalError && s.Operation == "db.query"));
Assert.All(spans, span => Assert.True(span.IsFinished));
Expand Down Expand Up @@ -150,7 +150,7 @@ public async Task EfCoreIntegration_RunAsyncQuery_TransactionWithSpansWithOneCom
Assert.Equal(totalCommands, itemsList.Count);
Assert.Equal(totalCommands, spans.Count(s => s.Operation == "db.query"));
#if NET5_0_OR_GREATER
Assert.Equal(totalCommands, spans.Count(s => s.Operation == "db.query_compiler"));
Assert.Equal(totalCommands, spans.Count(s => s.Operation == "db.query.compile"));
#endif
Assert.All(spans, span =>
{
Expand Down Expand Up @@ -183,7 +183,7 @@ public async Task EfCoreIntegration_RunAsyncQuery_TransactionWithSpans()
Assert.Equal(3, result[0].Result.Count);
Assert.Equal(4, spans.Count(s => s.Operation == "db.query"));
#if NET5_0_OR_GREATER
Assert.Equal(4, spans.Count(s => s.Operation == "db.query_compiler"));
Assert.Equal(4, spans.Count(s => s.Operation == "db.query.compile"));
#endif
Assert.All(spans, span =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static Func<ISpan, bool> GetValidator(string type)
_ when
type == EFQueryCompiling ||
type == EFQueryCompiled
=> span => span.Description != null && span.Operation == "db.query_compiler",
=> span => span.Description != null && span.Operation == "db.query.compile",
_ when
type == EFConnectionOpening ||
type == EFConnectionClosed
Expand Down