-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
3742 lines (3633 loc) · 113 KB
/
openapi.yaml
File metadata and controls
3742 lines (3633 loc) · 113 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Uptrace JSON API
version: "1.0.0"
description: |
REST API for managing Uptrace resources including monitors and dashboards.
This API allows you to create, update, retrieve, and delete monitors and dashboards programmatically.
## Authentication
To use the API, you need a project ID (`<project_id>`) and a user authentication token (`<user_token>`).
You can create an authentication token on your user profile page. The token has the same permissions as the user account, allowing access to the same resources.
### SSO
User auth tokens do not work with Single Sign-On (SSO) because SSO requires Uptrace to redirect users to the SSO provider, which is not viable for the JSON API.
If your organization uses SSO, you need to create a separate user account and statically grant it access to projects without relying on SSO authentication.
## Usage Limits
Uptrace Cloud provides this API free of charge for occasional use to read small fractions of ingested data. For example, a few requests per hour to read data from the last few hours is acceptable.
If you need higher usage limits, please contact [support](mailto:support@uptrace.dev) to discuss your use case.
contact:
name: Uptrace
url: https://uptrace.dev
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: https://api.uptrace.dev
description: Public API server
security:
- bearerAuth: []
- authTokenQuery: []
paths:
/api/v1/annotations:
post:
summary: Create annotation
operationId: create_annotation
description: Create a chart annotation.
tags: [Annotations]
security:
- uptraceDSNHeader: []
- dsnQuery: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AnnotationCreateRequest"
example:
name: Deployed to production
fingerprint: v1.2.3
attrs:
service.version: v1.2.3
responses:
"200":
description: Annotation created.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/tracing/{project_id}/spans:
get:
summary: List spans
x-badges:
- name: global
operationId: public_list_spans
description: >-
List spans (public API). Stable API for listing spans by trace_id, span_id, or parent_id.
Best for retrieving known spans when you already have an ID.
For advanced filtering with UQL queries (WHERE, search, system filtering),
use list_spans instead.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: trace_id
in: query
description: Filter spans by trace ID.
schema:
type: string
example: 17706d68ea23cf9bc8976ca57d22ee31
- name: id
in: query
description: Filter spans by span ID.
schema:
type: integer
example: 12345
- name: parent_id
in: query
description: Filter spans by parent span ID.
schema:
type: integer
example: 12345
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: List of spans.
content:
application/json:
schema:
type: object
properties:
spans:
type: array
description: Array of span objects.
items:
$ref: "#/components/schemas/Span"
hasMore:
type: boolean
description: Whether more results exist beyond the limit.
required: [spans]
example:
spans:
- id: "acb4d95e58413013"
traceId: "17706d68ea23cf9bc8976ca57d22ee31"
parentId: ""
name: GET /api/v1/orders
kind: server
time: 1688947201000.0
duration: 1.2
statusCode: ok
hasMore: false
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/tracing/{project_id}/groups:
get:
summary: List groups
x-badges:
- name: global
operationId: public_list_span_groups
description: >-
List span groups (public API). Stable API for listing aggregated span groups.
Supports basic search and duration filtering.
For advanced aggregation with UQL queries (GROUP BY, HAVING, aggregate functions),
use list_span_groups instead.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: Aggregate spans using the specified query.
schema:
type: string
example: group by host_name
- $ref: "#/components/parameters/Limit"
- name: search
in: query
description: Search for spans containing option1 or option2.
schema:
type: string
example: option1|option2
- name: duration_gte
in: query
description: Duration greater than or equal to N (milliseconds).
schema:
type: integer
format: int64
example: 1000
- name: duration_lt
in: query
description: Duration less than N (milliseconds).
schema:
type: integer
format: int64
example: 5000
responses:
"200":
description: Aggregated spans.
content:
application/json:
schema:
type: object
properties:
groups:
type: array
description: Array of group rows with dynamic columns based on the query.
items:
type: object
additionalProperties: true
hasMore:
type: boolean
description: Whether more results exist beyond the limit.
required: [groups]
example:
groups:
- host_name: host-1
count: 1240
errorCount: 12
p50: 850
p95: 2400
hasMore: false
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/spans:
get:
summary: List spans
operationId: list_spans
description: >-
List individual spans using UQL (Uptrace Query Language).
Use this to inspect specific span details, search for errors, or browse recent operations.
Supports WHERE filters (e.g. where service_name = 'myservice', where _status_code = 'error',
where _dur_ms > 100ms), full-text search (e.g. word1|word2 -excluded),
system filtering (e.g. httpserver:all, db:postgresql, log:error),
duration filtering in milliseconds, and sorting by any span field.
Span fields use underscore prefix: _name, _dur_ms, _status_code, _time, _trace_id, _kind.
Attributes use dot-to-underscore: service.name becomes service_name.
Returns individual span objects with attrs, timing, and status.
Use list_span_groups instead when you need aggregated metrics (count, avg, p99).
Use list_traces instead when you need to find traces matching multi-span criteria.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL query to filter spans (e.g., where service_name = 'myservice').
schema:
type: string
example: "where service_name = 'myservice'"
- name: where
in: query
description: Additional WHERE clause appended to the query.
schema:
type: string
example: "service_name = 'myservice'"
- name: search
in: query
description: Full-text search for spans containing the given text.
schema:
type: string
example: "GET /api"
- name: search_attrs
in: query
description: Attribute names to search within when using search. Can be repeated for multiple attributes.
schema:
type: array
items:
type: string
example: ["display_name"]
- name: system
in: query
description: Filter by system (e.g., log:error, db:postgresql). Can be repeated for multiple systems.
schema:
type: array
items:
type: string
example: ["log:error"]
- name: sort_by
in: query
description: Column names to sort by. Can be repeated for multi-column sort. Defaults to time.
schema:
type: array
items:
type: string
example: ["_time"]
- name: sort_dir
in: query
description: Sort direction for each sort_by column. Must match sort_by count. Defaults to DESC.
schema:
type: array
items:
$ref: '#/components/schemas/SortDirection'
example: ["DESC"]
- name: duration_gte
in: query
description: Duration greater than or equal to N (milliseconds).
schema:
type: integer
format: int64
example: 1000
- name: duration_lt
in: query
description: Duration less than N (milliseconds).
schema:
type: integer
format: int64
example: 5000
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: List of matching spans.
content:
application/json:
schema:
type: object
properties:
spans:
type: array
description: Array of span objects.
items:
$ref: "#/components/schemas/Span"
count:
type: integer
format: int64
description: Total count of matching spans.
query:
type: array
description: Parsed query parts with error state.
items:
type: object
additionalProperties: true
sorting:
type: array
description: Applied sorting configuration.
items:
$ref: '#/components/schemas/OrderItem'
search:
type: array
description: Applied search matchers.
items:
type: object
additionalProperties: true
whereAttrs:
type: object
description: Map of WHERE attribute names to their matched values.
additionalProperties: true
required: [spans, count]
example:
spans:
- id: "acb4d95e58413013"
traceId: "07f3834da9d146dd4d6aea67fe5b1e95"
parentId: "6a1445d6b82b6c5d"
name: GET /api/v1/orders
kind: server
time: 1770985573458.9
duration: 1.2
statusCode: ok
count: 1
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/groups:
get:
summary: List groups
operationId: list_span_groups
description: >-
Aggregate spans into groups using UQL queries.
Use this to get aggregated metrics like request count, error rate, or latency percentiles.
Aggregate functions: count(), avg(), sum(), min(), max(),
p50(), p75(), p90(), p99(), uniq(), apdex().
Supports GROUP BY (e.g. group by service_name), HAVING (e.g. having p50(_dur_ms) > 100ms),
WHERE filters, full-text search, system filtering (e.g. httpserver:all, db:postgresql),
and duration filtering. Example query: 'perMin(count()) | group by host_name'.
Returns grouped rows with dynamic columns based on the query.
Use list_spans instead when you need individual span details.
Use timeseries instead when you need time-bucketed data for charts.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL aggregation query (e.g., perMin(count()) | group by host_name).
schema:
type: string
example: "perMin(count()) | group by host_name"
- name: where
in: query
description: Additional WHERE clause appended to the query.
schema:
type: string
example: "service_name = 'myservice'"
- name: search
in: query
description: Full-text search for spans containing the given text.
schema:
type: string
example: "GET /api"
- name: search_attrs
in: query
description: Attribute names to search within when using search. Can be repeated for multiple attributes.
schema:
type: array
items:
type: string
example: ["display_name"]
- name: system
in: query
description: Filter by system (e.g., log:error, db:postgresql). Can be repeated for multiple systems.
schema:
type: array
items:
type: string
example: ["spans:all"]
- name: sort_by
in: query
description: Column names to sort by. Can be repeated for multi-column sort.
schema:
type: array
items:
type: string
example: ["count"]
- name: sort_dir
in: query
description: Sort direction for each sort_by column. Must match sort_by count. Defaults to DESC.
schema:
type: array
items:
$ref: '#/components/schemas/SortDirection'
example: ["DESC"]
- name: duration_gte
in: query
description: Duration greater than or equal to N (milliseconds).
schema:
type: integer
format: int64
example: 1000
- name: duration_lt
in: query
description: Duration less than N (milliseconds).
schema:
type: integer
format: int64
example: 5000
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: Aggregated span groups.
content:
application/json:
schema:
$ref: "#/components/schemas/GroupsResult"
example:
groups:
- host_name: host-1
count: 1240
errorCount: 12
p50: 850
p95: 2400
columns:
- name: count
isNum: true
hasMore: false
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/timeseries:
get:
summary: Timeseries
operationId: query_timeseries
description: >-
Query time-bucketed aggregation data for spans.
Use this to analyze trends over time, detect anomalies, or build charts.
Returns aligned timestamps with auto-computed interval based on the time range.
Use UQL aggregation query (e.g. perMin(count()) | group by service_name)
with aggregate functions: count(), avg(), sum(), p50(), p90(), p99(), etc.
Use column parameter to select specific aggregate columns for the timeseries.
Supports WHERE filters, full-text search, system filtering, and duration filtering.
Returns groups with arrays of float values aligned with the time array.
Use list_span_groups instead when you need a single aggregated snapshot (not time-bucketed).
Use quantiles instead when you only need latency percentiles (p50/p90/p99).
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL aggregation query (e.g., perMin(count()) | group by service_name).
schema:
type: string
example: "perMin(count()) | group by service_name"
- name: where
in: query
description: Additional WHERE clause appended to the query.
schema:
type: string
example: "service_name = 'myservice'"
- name: search
in: query
description: Full-text search for spans containing the given text.
schema:
type: string
example: "GET /api"
- name: search_attrs
in: query
description: Attribute names to search within when using search. Can be repeated for multiple attributes.
schema:
type: array
items:
type: string
example: ["display_name"]
- name: system
in: query
description: Filter by system (e.g., log:error, db:postgresql). Can be repeated for multiple systems.
schema:
type: array
items:
type: string
example: ["spans:all"]
- name: column
in: query
description: Aggregate column names to include in the timeseries. Can be repeated for multiple columns.
schema:
type: array
items:
type: string
example: ["count"]
- name: duration_gte
in: query
description: Duration greater than or equal to N (milliseconds).
schema:
type: integer
format: int64
example: 10000
- name: duration_lt
in: query
description: Duration less than N (milliseconds).
schema:
type: integer
format: int64
example: 100000
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: Timeseries data.
content:
application/json:
schema:
type: object
properties:
groups:
type: array
description: Array of group rows. Aggregated columns contain arrays of float values aligned with the time array.
items:
type: object
additionalProperties: true
columns:
type: array
description: Column definitions for the result.
items:
$ref: "#/components/schemas/QueryColumn"
time:
type: array
description: Array of aligned timestamps as unix milliseconds.
items:
type: number
format: double
interval:
type: integer
format: int64
description: Time interval between data points in milliseconds.
query:
type: array
description: Parsed query parts with error state.
items:
type: object
additionalProperties: true
sorting:
type: array
description: Applied sorting configuration.
items:
$ref: '#/components/schemas/OrderItem'
whereAttrs:
type: object
description: Map of WHERE attribute names to their matched values.
additionalProperties: true
required: [groups, time, interval]
example:
groups:
- service_name: myservice
"perMin(count())": [10.5, 20.3, 15.1, 30.7]
time: [1688947200000, 1688947260000, 1688947320000, 1688947380000]
interval: 60000
columns:
- expr: "perMin(count())"
name: "perMin(count())"
isAgg: true
isNum: true
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/quantiles:
get:
summary: Quantiles
operationId: query_quantiles
description: >-
Query duration percentiles (p50, p90, p99) and count/error rate over time.
Use this to identify latency outliers, track performance degradation, or compare SLO compliance.
Returns named timeseries: count, countPerMin, errorCount, errorCountPerMin,
durationP50, durationP90, durationP99, durationMax.
Supports WHERE filters (e.g. where service_name = 'myservice'),
full-text search, system filtering (e.g. httpserver:all), and duration filtering.
Use timeseries instead when you need custom aggregation queries with GROUP BY.
Use list_span_groups instead when you need a single aggregated snapshot.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL query to filter spans (e.g., where service_name = 'myservice').
schema:
type: string
example: "where service_name = 'myservice'"
- name: where
in: query
description: Additional WHERE clause appended to the query.
schema:
type: string
example: "service_name = 'myservice'"
- name: search
in: query
description: Full-text search for spans containing the given text.
schema:
type: string
example: "GET /api"
- name: search_attrs
in: query
description: Attribute names to search within when using search. Can be repeated for multiple attributes.
schema:
type: array
items:
type: string
example: ["display_name"]
- name: system
in: query
description: Filter by system (e.g., log:error, db:postgresql). Can be repeated for multiple systems.
schema:
type: array
items:
type: string
example: ["spans:all"]
- name: duration_gte
in: query
description: Duration greater than or equal to N (milliseconds).
schema:
type: integer
format: int64
example: 10000
- name: duration_lt
in: query
description: Duration less than N (milliseconds).
schema:
type: integer
format: int64
example: 100000
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: Quantile timeseries data.
content:
application/json:
schema:
type: object
properties:
timeseries:
type: array
description: >-
Array of named timeseries. Names include: count, countPerMin, errorCount, errorCountPerMin,
durationP50, durationP90, durationP99, durationMax.
items:
$ref: "#/components/schemas/Timeseries"
required: [timeseries]
example:
timeseries:
- name: durationP50
value: [1.2, 1.3, 1.1]
time: [1688947200000, 1688947260000, 1688947320000]
- name: countPerMin
value: [100, 120, 90]
time: [1688947200000, 1688947260000, 1688947320000]
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/trace-groups:
get:
summary: List trace groups
operationId: list_trace_groups
description: >-
Aggregate traces into groups using correlated sub-queries.
Use this to find trace patterns and get aggregated trace metrics.
Requires parallel arrays: query[], alias[], system[] with matching lengths.
One alias must be 'root' to identify the root span query.
Additional sub-queries filter traces where child spans match specific criteria.
Systems: spans:all, httpserver:all, db:postgresql, log:error, etc.
Returns grouped rows with dynamic columns.
Use list_traces instead when you need individual trace details.
Use list_span_groups instead when you don't need cross-span trace correlation.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL query for each sub-query. Must have the same count as alias and system. Can be repeated.
schema:
type: array
items:
type: string
example: ["where service_name = 'myservice'"]
- name: alias
in: query
description: Alias for each sub-query. One alias must be 'root'. Can be repeated.
schema:
type: array
items:
type: string
example: ["root"]
- name: system
in: query
description: System for each sub-query (e.g., spans:all, log:error). Can be repeated.
schema:
type: array
items:
type: string
example: ["spans:all"]
- name: sort_by
in: query
description: Column names to sort by. Can be repeated for multi-column sort.
schema:
type: array
items:
type: string
example: ["count"]
- name: sort_dir
in: query
description: Sort direction for each sort_by column. Must match sort_by count. Defaults to DESC.
schema:
type: array
items:
$ref: '#/components/schemas/SortDirection'
example: ["DESC"]
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: Trace groups result.
content:
application/json:
schema:
$ref: "#/components/schemas/GroupsResult"
example:
groups:
- _group_id: "100"
count: 42
errorCount: 2
columns:
- name: count
isNum: true
hasMore: false
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/internal/v1/tracing/{project_id}/traces:
get:
summary: List traces
operationId: list_traces
description: >-
List individual traces using correlated sub-queries.
Use this to find specific traces matching complex multi-span criteria.
Requires parallel arrays: query[], alias[], system[] with matching lengths.
One alias must be 'root' to identify the root span query.
Additional sub-queries filter traces where child spans match specific criteria.
Systems: spans:all, httpserver:all, db:postgresql, log:error, etc.
Returns root spans for matching traces sorted by time (DESC by default).
Use list_trace_groups instead when you need aggregated trace metrics.
Use list_spans instead when you don't need cross-span trace correlation.
Documentation: https://uptrace.dev/features/querying/spans
tags: [Querying]
parameters:
- $ref: "#/components/parameters/ProjectId"
- $ref: "#/components/parameters/TimeStart"
- $ref: "#/components/parameters/TimeEnd"
- name: query
in: query
description: UQL query for each sub-query. Must have the same count as alias and system. Can be repeated.
schema:
type: array
items:
type: string
example: ["where service_name = 'myservice'"]
- name: alias
in: query
description: Alias for each sub-query. One alias must be 'root'. Can be repeated.
schema:
type: array
items:
type: string
example: ["root"]
- name: system
in: query
description: System for each sub-query (e.g., spans:all, log:error). Can be repeated.
schema:
type: array
items:
type: string
example: ["spans:all"]
- name: sort_by
in: query
description: Column names to sort by. Can be repeated for multi-column sort. Defaults to time.
schema:
type: array
items:
type: string
example: ["_time"]
- name: sort_dir
in: query
description: Sort direction for each sort_by column. Must match sort_by count. Defaults to DESC.
schema:
type: array
items:
$ref: '#/components/schemas/SortDirection'
example: ["DESC"]
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: List of matching traces.
content:
application/json:
schema:
type: object
properties:
spans:
type: array
description: Root spans for matching traces.
items:
$ref: "#/components/schemas/Span"
count:
type: integer
format: int64
description: Total count of matching traces.
query:
type: array
description: Parsed query parts with error state.
items:
type: object
additionalProperties: true
sorting:
type: array
description: Applied sorting configuration.
items:
$ref: '#/components/schemas/OrderItem'
search:
type: array
description: Applied search matchers.
items:
type: object
additionalProperties: true
whereAttrs:
type: object
description: Map of WHERE attribute names to their matched values.
additionalProperties: true
required: [spans, count]
example:
spans:
- id: "298ec3d46392d4b7"
traceId: "103ba7cd7900cdf2b04e842e15ad9702"
name: GET /api/v1/orders
displayName: GET /api/v1/orders
time: 1770985602526.471
duration: 1.634
statusCode: ok
count: 1
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/fixtures:
put:
summary: Sync fixtures
operationId: sync_fixtures
description:
Create, update, or delete users, orgs, projects, and related resources
using fixture keys.
tags: [Fixtures]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SeedDataRequest"
example:
users:
- key: admin_user
name: System Administrator
email: admin@company.com
password: change_me_immediately
orgs:
- key: main_org
name: Acme Corporation
orgUsers:
- key: admin_membership
orgKey: main_org
userKey: admin_user
role: owner
projects:
- key: web_app_project
name: Web Application
orgKey: main_org
responses:
"200":
description: Fixtures applied successfully.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
/api/v1/fixtures/bindings:
put:
summary: Bind existing resources to fixture keys
operationId: bind_fixture_keys
description: Assign fixture keys to existing resources created outside of fixtures.
tags: [Fixtures]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/LinkDataRequest"
example:
orgs:
- id: 123
key: legacy_org
projects:
- id: 456
key: existing_project
responses:
"200":
description: Bindings applied successfully.
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"