@@ -9,7 +9,6 @@ Add the package `Cassandra.OpenTelemetry` to the project and add the extension m
9
9
``` csharp
10
10
var cluster = Cluster .Builder ()
11
11
.AddContactPoint (Program .ContactPoint )
12
- .WithSessionName (Program .SessionName )
13
12
.WithOpenTelemetryInstrumentation ()
14
13
.Build ();
15
14
```
@@ -29,11 +28,13 @@ The table below displays the list of included attributes in this feature:
29
28
| Attribute | Description | Output Values |
30
29
| -- - | -- - | -- - |
31
30
| db .namespace | The keyspace name . | * keyspace in use * |
32
- | db .operation .name | The type name of the operation being executed . | * Session Request * for session level calls and * Node Request * for node level calls |
33
- | db .query .text | The database statement being executed . Included as [optional configuration ](#include - statement - as - an - attribute ). | * database statement in use * |
34
- | db .system | An identifier for the database management system (DBMS ) product being used . | cassandra |
35
- | server .address | The host node . | e .g .: 127.0.0.1 |
36
- | server .port | Port number . | e .g .: 9042 |
31
+ | db .operation .name | The type name of the operation being executed . | `Session_Request ({RequestType })` for session level calls and `Node_Request ({RequestType })` for node level calls |
32
+ | db .query .text | The database statement being executed . Included as [optional configuration ](#include - statement - as - an - attribute ). | e .g .: `SELECT * FROM system .local ` |
33
+ | db .system | An identifier for the database management system (DBMS ) product being used . | `cassandra ` |
34
+ | server .address | The host node . | e .g .: `127.0.0.1 ` |
35
+ | server .port | Port number . | e .g .: `9042 ` |
36
+
37
+ Note that in some cases the driver does not know which keyspace a request is targeting because the driver doesn 't parse CQL query strings .
37
38
38
39
The console log below displays an example of a full Cassandra activity :
39
40
@@ -43,15 +44,15 @@ Activity.SpanId: bd42cfc78b552cd1
43
44
Activity .TraceFlags : Recorded
44
45
Activity .ActivitySourceName : Cassandra .OpenTelemetry
45
46
Activity .ActivitySourceVersion : 1.0.0.0
46
- Activity .DisplayName : Session Request
47
+ Activity .DisplayName : Session_Request ( SimpleStatement ) system
47
48
Activity .Kind : Client
48
49
Activity .StartTime : 2024 - 09 - 13T14 : 08 : 36.9762191Z
49
50
Activity .Duration : 00 : 00 : 00 . 0416284
50
51
Activity .Tags :
51
52
db .system : cassandra
52
- db .operation .name : Session Request
53
+ db .operation .name : Session_Request ( SimpleStatement )
53
54
db .namespace : system
54
- db .query .text : SELECT * FROM system . local
55
+ db .query .text : SELECT * FROM local
55
56
Resource associated with Activity :
56
57
service .name : CassandraDemo
57
58
service .version : 1.0.0
@@ -72,7 +73,17 @@ As mentioned above, the attribute `db.query.text` is not included by default in
72
73
```csharp
73
74
var cluster = Cluster .Builder ()
74
75
.AddContactPoint (Program .ContactPoint )
75
- .WithSessionName (Program .SessionName )
76
76
.AddOpenTelemetryInstrumentation (options => options .IncludeDatabaseStatement = true )
77
77
.Build ();
78
+ ```
79
+
80
+ ### Batch Statement size
81
+
82
+ By default, the ` OpenTelemetry ` extension only uses up to ` 5 ` child statements of a ` BatchStatement ` to generate the ` db.query.text ` tag. If you want to change this number, set the ` CassandraInstrumentationOptions ` property ` BatchChildStatementLimit ` :
83
+
84
+ ``` csharp
85
+ var cluster = Cluster .Builder ()
86
+ .AddContactPoint (Program .ContactPoint )
87
+ .AddOpenTelemetryInstrumentation (options => options .BatchChildStatementLimit = 10 )
88
+ .Build ();
78
89
```
0 commit comments