@@ -693,8 +693,12 @@ func validateDQLSchemaForGraphQL(ctx context.Context,
693
693
return nil
694
694
}
695
695
696
+ func annotateNamespace (span * otrace.Span , ns uint64 ) {
697
+ span .AddAttributes (otrace .Int64Attribute ("ns" , int64 (ns )))
698
+ }
699
+
696
700
func annotateStartTs (span * otrace.Span , ts uint64 ) {
697
- span .Annotate ([] otrace.Attribute { otrace . Int64Attribute ("startTs" , int64 (ts ))}, "" )
701
+ span .AddAttributes ( otrace .Int64Attribute ("startTs" , int64 (ts )))
698
702
}
699
703
700
704
func (s * Server ) doMutate (ctx context.Context , qc * queryContext , resp * api.Response ) error {
@@ -1331,6 +1335,10 @@ func (s *Server) doQuery(ctx context.Context, req *Request) (
1331
1335
1332
1336
var measurements []ostats.Measurement
1333
1337
ctx , span := otrace .StartSpan (ctx , methodRequest )
1338
+ if ns , err := x .ExtractNamespace (ctx ); err == nil {
1339
+ annotateNamespace (span , ns )
1340
+ }
1341
+
1334
1342
ctx = x .WithMethod (ctx , methodRequest )
1335
1343
defer func () {
1336
1344
span .End ()
@@ -1691,6 +1699,9 @@ func (s *Server) CommitOrAbort(ctx context.Context, tc *api.TxnContext) (*api.Tx
1691
1699
return & api.TxnContext {}, errors .Errorf (
1692
1700
"StartTs cannot be zero while committing a transaction" )
1693
1701
}
1702
+ if ns , err := x .ExtractJWTNamespace (ctx ); err == nil {
1703
+ annotateNamespace (span , ns )
1704
+ }
1694
1705
annotateStartTs (span , tc .StartTs )
1695
1706
1696
1707
if err := validateNamespace (ctx , tc ); err != nil {
0 commit comments