Skip to content

Commit 2900e7c

Browse files
Feat ADO.NET tracing: Refined error.type for YdbException to classify failures as transport_error (client transport status codes) or ydb_error (database status codes), while keeping db.response.status_code (#614)
1 parent bc344ff commit 2900e7c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Ydb.Sdk/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- Feat ADO.NET tracing: Refined `error.type` for `YdbException` to classify failures as `transport_error` (client transport status codes) or `ydb_error` (database status codes), while keeping `db.response.status_code`.
2+
13
## v0.30.0
24

35
- Upgraded target framework from .NET 6/7 to .NET 8.

src/Ydb.Sdk/src/Tracing/YdbActivitySource.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ internal static void SetException(this Activity activity, Exception exception)
1616
if (exception is YdbException ydbException)
1717
{
1818
activity.SetTag("db.response.status_code", ydbException.Code);
19-
activity.SetTag("error.type", ydbException.Code);
19+
activity.SetTag("error.type", ydbException.Code
20+
is StatusCode.ClientTransportUnknown
21+
or StatusCode.ClientTransportUnavailable
22+
or StatusCode.ClientTransportTimeout
23+
or StatusCode.ClientTransportResourceExhausted
24+
or StatusCode.ClientTransportUnimplemented
25+
? "transport_error"
26+
: "ydb_error");
2027
}
2128
else
2229
{

0 commit comments

Comments
 (0)