@@ -135,7 +135,7 @@ client.query(query);
135135After response is returned, ` elements ` can be fetched,
136136
137137``` java
138- StreamQueryResponse resp = client. queryStreams (query);
138+ StreamQueryResponse resp = client. query (query);
139139List<RowEntity > entities = resp. getElements();
140140```
141141
@@ -145,6 +145,23 @@ The `StreamQueryResponse`, `RowEntity`, `TagFamily` and `Tag` (i.e. `TagAndValue
145145the order of the tag families and containing tags, i.e. indexes of these objects in the List, follow the order specified
146146in the projection condition we've used in the request.
147147
148+ If you want to trace the query, you can use ` query.enableTrace() ` to get the trace spans.
149+
150+ ``` java
151+ // enable trace
152+ query. enableTrace();
153+ // send the query request
154+ client. query(query);
155+ ```
156+
157+ After response is returned, ` trace ` can be extracted,
158+
159+ ``` java
160+ // send the query request
161+ StreamQueryResponse resp = client. queryStreams(query);
162+ Trace t = resp. getTrace();
163+ ```
164+
148165### Measure
149166
150167For ` Measure ` , it is similar to the ` Stream ` ,
@@ -193,6 +210,22 @@ query.offset(1);
193210query. orderBy(" service_id" , Sort . DESC );
194211```
195212
213+ If you want to trace the query, you can use ` query.enableTrace() ` to get the trace spans.
214+
215+ ``` java
216+ // enable trace
217+ query. enableTrace();
218+ // send the query request
219+ client. query(query);
220+ ```
221+
222+ After response is returned, ` trace ` can be extracted,
223+
224+ ``` java
225+ // send the query request
226+ MeasureQueryResponse resp = client. query(query);
227+ Trace trace = resp. getTrace();
228+ ```
196229### Criteria
197230
198231Both ` StreamQuery ` and ` MeausreQuery ` support the ` criteria ` flag to filter data.
0 commit comments