@ancplua/qyl-api-schema 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +89 -0
- package/VERSIONING.md +74 -0
- package/api/routes.tsp +1052 -0
- package/api/streaming.tsp +335 -0
- package/common/errors.tsp +206 -0
- package/common/pagination.tsp +254 -0
- package/common/types.tsp +345 -0
- package/generated/README.md +26 -0
- package/generated/otel-keys.gen.tsp +1648 -0
- package/index.tsp +55 -0
- package/intelligence/causal-rules.tsp +34 -0
- package/intelligence/diagnostic-patterns.tsp +54 -0
- package/intelligence/investigation-strategies.tsp +37 -0
- package/intelligence/main.tsp +19 -0
- package/intelligence/seed/patterns.tsp +172 -0
- package/intelligence/seed/rules.tsp +44 -0
- package/intelligence/seed/strategies.tsp +56 -0
- package/intelligence/signals.tsp +60 -0
- package/models/agent/agent-run.tsp +154 -0
- package/models/agent/tool-call.tsp +122 -0
- package/models/agent/workflow-checkpoint.tsp +50 -0
- package/models/agent/workflow-execution.tsp +136 -0
- package/models/alerting.tsp +436 -0
- package/models/configurator.tsp +433 -0
- package/models/control-graph.tsp +197 -0
- package/models/db.tsp +810 -0
- package/models/deployment.tsp +365 -0
- package/models/error.tsp +433 -0
- package/models/genai.tsp +1368 -0
- package/models/http.tsp +600 -0
- package/models/identity.tsp +213 -0
- package/models/issues.tsp +484 -0
- package/models/log.tsp +140 -0
- package/models/messaging.tsp +304 -0
- package/models/otel-config.tsp +455 -0
- package/models/retention.tsp +240 -0
- package/models/rpc.tsp +309 -0
- package/models/search.tsp +243 -0
- package/models/session.tsp +274 -0
- package/models/system.tsp +400 -0
- package/models/test.tsp +346 -0
- package/models/triage.tsp +113 -0
- package/models/workflow.tsp +396 -0
- package/models/workspace.tsp +435 -0
- package/otel/enums.tsp +392 -0
- package/otel/logs.tsp +135 -0
- package/otel/metrics.tsp +358 -0
- package/otel/otel-conventions.tsp +14 -0
- package/otel/profiles.tsp +335 -0
- package/otel/resource.tsp +257 -0
- package/otel/span.tsp +307 -0
- package/package.json +88 -0
- package/tspconfig.yaml +49 -0
package/otel/metrics.tsp
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ANcpLua v2.0 - OpenTelemetry Metrics Model
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Metrics data model with discriminated unions for different metric types.
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
import "@typespec/http";
|
|
8
|
+
import "../common/types.tsp";
|
|
9
|
+
import "./enums.tsp";
|
|
10
|
+
import "./resource.tsp";
|
|
11
|
+
|
|
12
|
+
using TypeSpec.Http;
|
|
13
|
+
using Qyl.Api.Contracts.Common;
|
|
14
|
+
using Qyl.Api.Contracts.OTel.Enums;
|
|
15
|
+
using Qyl.Api.Contracts.OTel.Resource;
|
|
16
|
+
|
|
17
|
+
namespace Qyl.Api.Contracts.OTel.Metrics;
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// Metric Model
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
@doc("OpenTelemetry Metric containing measurement data")
|
|
24
|
+
model Metric {
|
|
25
|
+
@doc("Metric name (e.g., http.server.request.duration)")
|
|
26
|
+
@minLength(1)
|
|
27
|
+
name: string;
|
|
28
|
+
|
|
29
|
+
@doc("Metric description")
|
|
30
|
+
description?: string;
|
|
31
|
+
|
|
32
|
+
@doc("Metric unit (e.g., 's', 'By', '1')")
|
|
33
|
+
unit?: string;
|
|
34
|
+
|
|
35
|
+
@doc("Metric data (discriminated by type)")
|
|
36
|
+
data: MetricData;
|
|
37
|
+
|
|
38
|
+
@doc("Metric metadata attributes")
|
|
39
|
+
metadata?: Attribute[];
|
|
40
|
+
|
|
41
|
+
@doc("Resource describing the entity that produced this metric")
|
|
42
|
+
resource: Qyl.Api.Contracts.OTel.Resource.Resource;
|
|
43
|
+
|
|
44
|
+
@doc("Instrumentation scope")
|
|
45
|
+
@encodedName("application/json", "instrumentation_scope")
|
|
46
|
+
instrumentationScope?: InstrumentationScope;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// Metric Data Types (Discriminated Union)
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
@doc("Metric data discriminated by type")
|
|
54
|
+
@discriminator("type")
|
|
55
|
+
model MetricData {
|
|
56
|
+
@doc("Metric type discriminator")
|
|
57
|
+
type: MetricType;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@doc("Gauge metric - instantaneous value at a point in time")
|
|
61
|
+
model GaugeData extends MetricData {
|
|
62
|
+
/** Discriminator identifying this as gauge metric data */
|
|
63
|
+
type: MetricType.gauge;
|
|
64
|
+
|
|
65
|
+
@doc("Gauge data points")
|
|
66
|
+
@encodedName("application/json", "data_points")
|
|
67
|
+
dataPoints: NumberDataPoint[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@doc("Sum metric - cumulative or delta counter")
|
|
71
|
+
model SumData extends MetricData {
|
|
72
|
+
/** Discriminator identifying this as sum metric data */
|
|
73
|
+
type: MetricType.sum;
|
|
74
|
+
|
|
75
|
+
@doc("Sum data points")
|
|
76
|
+
@encodedName("application/json", "data_points")
|
|
77
|
+
dataPoints: NumberDataPoint[];
|
|
78
|
+
|
|
79
|
+
@doc("Whether the sum is monotonically increasing")
|
|
80
|
+
@encodedName("application/json", "is_monotonic")
|
|
81
|
+
isMonotonic: boolean;
|
|
82
|
+
|
|
83
|
+
@doc("Aggregation temporality")
|
|
84
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
85
|
+
aggregationTemporality: AggregationTemporality;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@doc("Histogram metric - distribution of values in buckets")
|
|
89
|
+
model HistogramData extends MetricData {
|
|
90
|
+
/** Discriminator identifying this as histogram metric data */
|
|
91
|
+
type: MetricType.histogram;
|
|
92
|
+
|
|
93
|
+
@doc("Histogram data points")
|
|
94
|
+
@encodedName("application/json", "data_points")
|
|
95
|
+
dataPoints: HistogramDataPoint[];
|
|
96
|
+
|
|
97
|
+
@doc("Aggregation temporality")
|
|
98
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
99
|
+
aggregationTemporality: AggregationTemporality;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@doc("Exponential histogram metric - distribution with exponential bucket boundaries")
|
|
103
|
+
model ExponentialHistogramData extends MetricData {
|
|
104
|
+
/** Discriminator identifying this as exponential histogram metric data */
|
|
105
|
+
type: MetricType.exponentialHistogram;
|
|
106
|
+
|
|
107
|
+
@doc("Exponential histogram data points")
|
|
108
|
+
@encodedName("application/json", "data_points")
|
|
109
|
+
dataPoints: ExponentialHistogramDataPoint[];
|
|
110
|
+
|
|
111
|
+
@doc("Aggregation temporality")
|
|
112
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
113
|
+
aggregationTemporality: AggregationTemporality;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@doc("Summary metric - pre-aggregated quantile distribution")
|
|
117
|
+
model SummaryData extends MetricData {
|
|
118
|
+
/** Discriminator identifying this as summary metric data */
|
|
119
|
+
type: MetricType.summary;
|
|
120
|
+
|
|
121
|
+
@doc("Summary data points")
|
|
122
|
+
@encodedName("application/json", "data_points")
|
|
123
|
+
dataPoints: SummaryDataPoint[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// =============================================================================
|
|
127
|
+
// Data Point Models
|
|
128
|
+
// =============================================================================
|
|
129
|
+
|
|
130
|
+
@doc("Base data point with common fields")
|
|
131
|
+
model DataPointBase {
|
|
132
|
+
@doc("Start timestamp in nanoseconds since epoch")
|
|
133
|
+
@encodedName("application/json", "start_time_unix_nano")
|
|
134
|
+
startTimeUnixNano: UnixNanos;
|
|
135
|
+
|
|
136
|
+
@doc("End timestamp in nanoseconds since epoch")
|
|
137
|
+
@encodedName("application/json", "time_unix_nano")
|
|
138
|
+
timeUnixNano: UnixNanos;
|
|
139
|
+
|
|
140
|
+
@doc("Data point attributes")
|
|
141
|
+
attributes?: Attribute[];
|
|
142
|
+
|
|
143
|
+
@doc("Data point flags")
|
|
144
|
+
flags?: DataPointFlags;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@doc("Numeric data point (for Gauge and Sum)")
|
|
148
|
+
model NumberDataPoint extends DataPointBase {
|
|
149
|
+
@doc("Value as integer")
|
|
150
|
+
@encodedName("application/json", "as_int")
|
|
151
|
+
asInt?: int64;
|
|
152
|
+
|
|
153
|
+
@doc("Value as double")
|
|
154
|
+
@encodedName("application/json", "as_double")
|
|
155
|
+
asDouble?: float64;
|
|
156
|
+
|
|
157
|
+
@doc("Exemplars for the data point")
|
|
158
|
+
exemplars?: Exemplar[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@doc("Histogram data point")
|
|
162
|
+
model HistogramDataPoint extends DataPointBase {
|
|
163
|
+
@doc("Number of values in the histogram")
|
|
164
|
+
count: int64;
|
|
165
|
+
|
|
166
|
+
@doc("Sum of all values")
|
|
167
|
+
sum?: float64;
|
|
168
|
+
|
|
169
|
+
@doc("Bucket counts")
|
|
170
|
+
@encodedName("application/json", "bucket_counts")
|
|
171
|
+
bucketCounts: int64[];
|
|
172
|
+
|
|
173
|
+
@doc("Explicit bucket boundaries")
|
|
174
|
+
@encodedName("application/json", "explicit_bounds")
|
|
175
|
+
explicitBounds: float64[];
|
|
176
|
+
|
|
177
|
+
@doc("Minimum value")
|
|
178
|
+
min?: float64;
|
|
179
|
+
|
|
180
|
+
@doc("Maximum value")
|
|
181
|
+
max?: float64;
|
|
182
|
+
|
|
183
|
+
@doc("Exemplars for the data point")
|
|
184
|
+
exemplars?: Exemplar[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@doc("Exponential histogram data point")
|
|
188
|
+
model ExponentialHistogramDataPoint extends DataPointBase {
|
|
189
|
+
@doc("Number of values")
|
|
190
|
+
count: int64;
|
|
191
|
+
|
|
192
|
+
@doc("Sum of all values")
|
|
193
|
+
sum?: float64;
|
|
194
|
+
|
|
195
|
+
@doc("Scale factor for bucket boundaries")
|
|
196
|
+
scale: int32;
|
|
197
|
+
|
|
198
|
+
@doc("Zero count")
|
|
199
|
+
@encodedName("application/json", "zero_count")
|
|
200
|
+
zeroCount: int64;
|
|
201
|
+
|
|
202
|
+
@doc("Zero threshold")
|
|
203
|
+
@encodedName("application/json", "zero_threshold")
|
|
204
|
+
zeroThreshold?: float64;
|
|
205
|
+
|
|
206
|
+
@doc("Positive bucket counts")
|
|
207
|
+
positive: ExponentialBuckets;
|
|
208
|
+
|
|
209
|
+
@doc("Negative bucket counts")
|
|
210
|
+
negative: ExponentialBuckets;
|
|
211
|
+
|
|
212
|
+
@doc("Minimum value")
|
|
213
|
+
min?: float64;
|
|
214
|
+
|
|
215
|
+
@doc("Maximum value")
|
|
216
|
+
max?: float64;
|
|
217
|
+
|
|
218
|
+
@doc("Exemplars for the data point")
|
|
219
|
+
exemplars?: Exemplar[];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@doc("Exponential histogram buckets")
|
|
223
|
+
model ExponentialBuckets {
|
|
224
|
+
@doc("Offset of the first bucket")
|
|
225
|
+
offset: int32;
|
|
226
|
+
|
|
227
|
+
@doc("Bucket counts")
|
|
228
|
+
@encodedName("application/json", "bucket_counts")
|
|
229
|
+
bucketCounts: int64[];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@doc("Summary data point")
|
|
233
|
+
model SummaryDataPoint extends DataPointBase {
|
|
234
|
+
@doc("Number of values")
|
|
235
|
+
count: int64;
|
|
236
|
+
|
|
237
|
+
@doc("Sum of all values")
|
|
238
|
+
sum: float64;
|
|
239
|
+
|
|
240
|
+
@doc("Quantile values")
|
|
241
|
+
@encodedName("application/json", "quantile_values")
|
|
242
|
+
quantileValues: QuantileValue[];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@doc("Quantile value for summary")
|
|
246
|
+
model QuantileValue {
|
|
247
|
+
@doc("Quantile (0.0 to 1.0)")
|
|
248
|
+
@minValue(0.0)
|
|
249
|
+
@maxValue(1.0)
|
|
250
|
+
quantile: float64;
|
|
251
|
+
|
|
252
|
+
@doc("Value at this quantile")
|
|
253
|
+
value: float64;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@doc("Exemplar - sample trace linked to metric")
|
|
257
|
+
model Exemplar {
|
|
258
|
+
@doc("Timestamp in nanoseconds since epoch")
|
|
259
|
+
@encodedName("application/json", "time_unix_nano")
|
|
260
|
+
timeUnixNano: UnixNanos;
|
|
261
|
+
|
|
262
|
+
@doc("Value as integer")
|
|
263
|
+
@encodedName("application/json", "as_int")
|
|
264
|
+
asInt?: int64;
|
|
265
|
+
|
|
266
|
+
@doc("Value as double")
|
|
267
|
+
@encodedName("application/json", "as_double")
|
|
268
|
+
asDouble?: float64;
|
|
269
|
+
|
|
270
|
+
@doc("Span ID of the exemplar")
|
|
271
|
+
@encodedName("application/json", "span_id")
|
|
272
|
+
spanId?: SpanId;
|
|
273
|
+
|
|
274
|
+
@doc("Trace ID of the exemplar")
|
|
275
|
+
@encodedName("application/json", "trace_id")
|
|
276
|
+
traceId?: TraceId;
|
|
277
|
+
|
|
278
|
+
@doc("Filtered attributes")
|
|
279
|
+
@encodedName("application/json", "filtered_attributes")
|
|
280
|
+
filteredAttributes?: Attribute[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// =============================================================================
|
|
284
|
+
// Metric Query & Aggregation
|
|
285
|
+
// =============================================================================
|
|
286
|
+
|
|
287
|
+
@doc("Metric query filters")
|
|
288
|
+
model MetricQueryFilters {
|
|
289
|
+
@doc("Filter by metric name (supports wildcards)")
|
|
290
|
+
@query
|
|
291
|
+
name?: string;
|
|
292
|
+
|
|
293
|
+
@doc("Filter by metric type")
|
|
294
|
+
@query
|
|
295
|
+
type?: MetricType;
|
|
296
|
+
|
|
297
|
+
@doc("Filter by service name")
|
|
298
|
+
@query
|
|
299
|
+
@encodedName("application/json", "service_name")
|
|
300
|
+
serviceName?: string;
|
|
301
|
+
|
|
302
|
+
@doc("Filter by attribute key-value pair")
|
|
303
|
+
@query
|
|
304
|
+
attribute?: string;
|
|
305
|
+
|
|
306
|
+
@doc("Aggregation function")
|
|
307
|
+
@query
|
|
308
|
+
@encodedName("application/json", "agg_func")
|
|
309
|
+
aggFunc?: AggregationFunction;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@doc("Aggregation functions for metrics")
|
|
313
|
+
enum AggregationFunction {
|
|
314
|
+
@doc("Sum of values")
|
|
315
|
+
sum: "sum",
|
|
316
|
+
|
|
317
|
+
@doc("Average of values")
|
|
318
|
+
avg: "avg",
|
|
319
|
+
|
|
320
|
+
@doc("Minimum value")
|
|
321
|
+
min: "min",
|
|
322
|
+
|
|
323
|
+
@doc("Maximum value")
|
|
324
|
+
max: "max",
|
|
325
|
+
|
|
326
|
+
@doc("Count of values")
|
|
327
|
+
count: "count",
|
|
328
|
+
|
|
329
|
+
@doc("Latest value")
|
|
330
|
+
last: "last",
|
|
331
|
+
|
|
332
|
+
@doc("Rate of change per second")
|
|
333
|
+
rate: "rate",
|
|
334
|
+
|
|
335
|
+
@doc("Increase over time range")
|
|
336
|
+
increase: "increase",
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@doc("Time series data for graphing")
|
|
340
|
+
model TimeSeries {
|
|
341
|
+
@doc("Metric name")
|
|
342
|
+
metric: string;
|
|
343
|
+
|
|
344
|
+
@doc("Dimension labels")
|
|
345
|
+
labels: Attribute[];
|
|
346
|
+
|
|
347
|
+
@doc("Data points over time")
|
|
348
|
+
points: TimeSeriesPoint[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@doc("Single point in a time series")
|
|
352
|
+
model TimeSeriesPoint {
|
|
353
|
+
@doc("Timestamp")
|
|
354
|
+
timestamp: utcDateTime;
|
|
355
|
+
|
|
356
|
+
@doc("Value")
|
|
357
|
+
value: float64;
|
|
358
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// otel/otel-conventions.tsp — OTel core barrel
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Exposed via the public subpath `@ancplua/qyl-api-schema/otel` for
|
|
5
|
+
// consumers that want only the OpenTelemetry-shaped signal models without the
|
|
6
|
+
// rest of the qyl API surface.
|
|
7
|
+
// =============================================================================
|
|
8
|
+
|
|
9
|
+
import "./enums.tsp";
|
|
10
|
+
import "./resource.tsp";
|
|
11
|
+
import "./span.tsp";
|
|
12
|
+
import "./logs.tsp";
|
|
13
|
+
import "./metrics.tsp";
|
|
14
|
+
import "./profiles.tsp";
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ANcpLua v2.0 - OpenTelemetry Profiles Model (v1development)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Continuous profiling signal following OTel Profiles proto specification.
|
|
5
|
+
// Proto package: opentelemetry.proto.profiles.v1development
|
|
6
|
+
// All attributes are Development stability (semconv v1.39.0-v1.40.0).
|
|
7
|
+
// =============================================================================
|
|
8
|
+
|
|
9
|
+
import "@typespec/http";
|
|
10
|
+
import "@typespec/openapi";
|
|
11
|
+
import "../common/types.tsp";
|
|
12
|
+
import "./enums.tsp";
|
|
13
|
+
import "./resource.tsp";
|
|
14
|
+
|
|
15
|
+
using TypeSpec.Http;
|
|
16
|
+
using TypeSpec.OpenAPI;
|
|
17
|
+
using Qyl.Api.Contracts.Common;
|
|
18
|
+
using Qyl.Api.Contracts.OTel.Enums;
|
|
19
|
+
using Qyl.Api.Contracts.OTel.Resource;
|
|
20
|
+
|
|
21
|
+
namespace Qyl.Api.Contracts.OTel.Profiles;
|
|
22
|
+
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Profile Model
|
|
25
|
+
// =============================================================================
|
|
26
|
+
|
|
27
|
+
@doc("OpenTelemetry Profile representing a continuous profiling snapshot")
|
|
28
|
+
model Profile {
|
|
29
|
+
@doc("Unique profile identifier (16 hex chars)")
|
|
30
|
+
@key
|
|
31
|
+
@encodedName("application/json", "profile_id")
|
|
32
|
+
profileId: string;
|
|
33
|
+
|
|
34
|
+
@doc("Sample type describing what was measured")
|
|
35
|
+
@encodedName("application/json", "sample_type")
|
|
36
|
+
sampleType?: ProfileValueType;
|
|
37
|
+
|
|
38
|
+
@doc("Profiling samples")
|
|
39
|
+
samples?: ProfileSample[];
|
|
40
|
+
|
|
41
|
+
@doc("Profile start timestamp in nanoseconds since epoch")
|
|
42
|
+
@encodedName("application/json", "time_unix_nano")
|
|
43
|
+
timeUnixNano: UnixNanos;
|
|
44
|
+
|
|
45
|
+
@doc("Profile duration in nanoseconds")
|
|
46
|
+
@encodedName("application/json", "duration_nano")
|
|
47
|
+
durationNano: DurationNs;
|
|
48
|
+
|
|
49
|
+
@doc("Sampling period type")
|
|
50
|
+
@encodedName("application/json", "period_type")
|
|
51
|
+
periodType?: ProfileValueType;
|
|
52
|
+
|
|
53
|
+
@doc("Sampling period value")
|
|
54
|
+
period?: int64;
|
|
55
|
+
|
|
56
|
+
@doc("Original payload format (pprof, jfr, linux_perf)")
|
|
57
|
+
@encodedName("application/json", "original_payload_format")
|
|
58
|
+
originalPayloadFormat?: OriginalPayloadFormat;
|
|
59
|
+
|
|
60
|
+
@doc("Original payload bytes (base64 encoded, opaque — not parsed)")
|
|
61
|
+
@encodedName("application/json", "original_payload")
|
|
62
|
+
originalPayload?: bytes;
|
|
63
|
+
|
|
64
|
+
@doc("Profile attributes")
|
|
65
|
+
attributes?: Attribute[];
|
|
66
|
+
|
|
67
|
+
@doc("Dropped attributes count")
|
|
68
|
+
@encodedName("application/json", "dropped_attributes_count")
|
|
69
|
+
droppedAttributesCount?: Count;
|
|
70
|
+
|
|
71
|
+
@doc("Resource describing the entity that produced this profile")
|
|
72
|
+
resource: Qyl.Api.Contracts.OTel.Resource.Resource;
|
|
73
|
+
|
|
74
|
+
@doc("Instrumentation scope")
|
|
75
|
+
@encodedName("application/json", "instrumentation_scope")
|
|
76
|
+
instrumentationScope?: InstrumentationScope;
|
|
77
|
+
|
|
78
|
+
// Dictionary tables (dereferenced from ProfilesDictionary)
|
|
79
|
+
|
|
80
|
+
@doc("String table for index-based lookups")
|
|
81
|
+
@encodedName("application/json", "string_table")
|
|
82
|
+
stringTable?: string[];
|
|
83
|
+
|
|
84
|
+
@doc("Function table")
|
|
85
|
+
@encodedName("application/json", "function_table")
|
|
86
|
+
functionTable?: ProfileFunction[];
|
|
87
|
+
|
|
88
|
+
@doc("Location table")
|
|
89
|
+
@encodedName("application/json", "location_table")
|
|
90
|
+
locationTable?: ProfileLocation[];
|
|
91
|
+
|
|
92
|
+
@doc("Mapping table (memory-mapped binaries)")
|
|
93
|
+
@encodedName("application/json", "mapping_table")
|
|
94
|
+
mappingTable?: ProfileMapping[];
|
|
95
|
+
|
|
96
|
+
@doc("Link table for cross-signal correlation")
|
|
97
|
+
@encodedName("application/json", "link_table")
|
|
98
|
+
linkTable?: ProfileLink[];
|
|
99
|
+
|
|
100
|
+
@doc("Stack table (ordered location sequences)")
|
|
101
|
+
@encodedName("application/json", "stack_table")
|
|
102
|
+
stackTable?: ProfileStack[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// =============================================================================
|
|
106
|
+
// Profile Sub-Models
|
|
107
|
+
// =============================================================================
|
|
108
|
+
|
|
109
|
+
@doc("Sample type descriptor (what was measured and in what unit)")
|
|
110
|
+
model ProfileValueType {
|
|
111
|
+
@doc("Type string index into string table")
|
|
112
|
+
@encodedName("application/json", "type_strindex")
|
|
113
|
+
typeStrindex?: int32;
|
|
114
|
+
|
|
115
|
+
@doc("Unit string index into string table")
|
|
116
|
+
@encodedName("application/json", "unit_strindex")
|
|
117
|
+
unitStrindex?: int32;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@doc("Individual profiling sample")
|
|
121
|
+
model ProfileSample {
|
|
122
|
+
@doc("Stack index into stack table")
|
|
123
|
+
@encodedName("application/json", "stack_index")
|
|
124
|
+
stackIndex?: int32;
|
|
125
|
+
|
|
126
|
+
@doc("Attribute indices into attribute table")
|
|
127
|
+
@encodedName("application/json", "attribute_indices")
|
|
128
|
+
attributeIndices?: int32[];
|
|
129
|
+
|
|
130
|
+
@doc("Link index into link table for cross-signal correlation")
|
|
131
|
+
@encodedName("application/json", "link_index")
|
|
132
|
+
linkIndex?: int32;
|
|
133
|
+
|
|
134
|
+
@doc("Sample values (one per sample type)")
|
|
135
|
+
values?: int64[];
|
|
136
|
+
|
|
137
|
+
@doc("Timestamps for each value in nanoseconds since epoch")
|
|
138
|
+
@encodedName("application/json", "timestamps_unix_nano")
|
|
139
|
+
timestampsUnixNano?: UnixNanos[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@doc("Code location within a profiled binary")
|
|
143
|
+
model ProfileLocation {
|
|
144
|
+
@doc("Mapping index into mapping table")
|
|
145
|
+
@encodedName("application/json", "mapping_index")
|
|
146
|
+
mappingIndex?: int32;
|
|
147
|
+
|
|
148
|
+
@doc("Instruction address (program counter)")
|
|
149
|
+
address?: uint64;
|
|
150
|
+
|
|
151
|
+
@doc("Source lines at this location")
|
|
152
|
+
lines?: ProfileLine[];
|
|
153
|
+
|
|
154
|
+
@doc("Attribute indices")
|
|
155
|
+
@encodedName("application/json", "attribute_indices")
|
|
156
|
+
attributeIndices?: int32[];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@doc("Source line within a location")
|
|
160
|
+
model ProfileLine {
|
|
161
|
+
@doc("Function index into function table")
|
|
162
|
+
@encodedName("application/json", "function_index")
|
|
163
|
+
functionIndex?: int32;
|
|
164
|
+
|
|
165
|
+
@doc("Source line number")
|
|
166
|
+
line?: int64;
|
|
167
|
+
|
|
168
|
+
@doc("Source column number")
|
|
169
|
+
column?: int64;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@doc("Function identity in a profiled binary")
|
|
173
|
+
model ProfileFunction {
|
|
174
|
+
@doc("Function name string index")
|
|
175
|
+
@encodedName("application/json", "name_strindex")
|
|
176
|
+
nameStrindex?: int32;
|
|
177
|
+
|
|
178
|
+
@doc("System/mangled function name string index")
|
|
179
|
+
@encodedName("application/json", "system_name_strindex")
|
|
180
|
+
systemNameStrindex?: int32;
|
|
181
|
+
|
|
182
|
+
@doc("Source filename string index")
|
|
183
|
+
@encodedName("application/json", "filename_strindex")
|
|
184
|
+
filenameStrindex?: int32;
|
|
185
|
+
|
|
186
|
+
@doc("First line number of the function in source")
|
|
187
|
+
@encodedName("application/json", "start_line")
|
|
188
|
+
startLine?: int64;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@doc("Memory mapping for a loaded binary or shared library")
|
|
192
|
+
model ProfileMapping {
|
|
193
|
+
@doc("Start address of the mapping in virtual memory")
|
|
194
|
+
@encodedName("application/json", "memory_start")
|
|
195
|
+
memoryStart?: uint64;
|
|
196
|
+
|
|
197
|
+
@doc("Limit address (exclusive) of the mapping")
|
|
198
|
+
@encodedName("application/json", "memory_limit")
|
|
199
|
+
memoryLimit?: uint64;
|
|
200
|
+
|
|
201
|
+
@doc("Offset within the mapped file")
|
|
202
|
+
@encodedName("application/json", "file_offset")
|
|
203
|
+
fileOffset?: uint64;
|
|
204
|
+
|
|
205
|
+
@doc("Filename string index of the mapped binary")
|
|
206
|
+
@encodedName("application/json", "filename_strindex")
|
|
207
|
+
filenameStrindex?: int32;
|
|
208
|
+
|
|
209
|
+
@doc("Attribute indices")
|
|
210
|
+
@encodedName("application/json", "attribute_indices")
|
|
211
|
+
attributeIndices?: int32[];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@doc("Cross-signal link from profile sample to trace/span")
|
|
215
|
+
model ProfileLink {
|
|
216
|
+
@doc("Linked trace ID (16 bytes, W3C format)")
|
|
217
|
+
@encodedName("application/json", "trace_id")
|
|
218
|
+
traceId?: TraceId;
|
|
219
|
+
|
|
220
|
+
@doc("Linked span ID (8 bytes)")
|
|
221
|
+
@encodedName("application/json", "span_id")
|
|
222
|
+
spanId?: SpanId;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@doc("Ordered sequence of location indices forming a call stack")
|
|
226
|
+
model ProfileStack {
|
|
227
|
+
@doc("Location indices from leaf (index 0) to root")
|
|
228
|
+
@encodedName("application/json", "location_indices")
|
|
229
|
+
locationIndices?: int32[];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// =============================================================================
|
|
233
|
+
// Profile Query Filters
|
|
234
|
+
// =============================================================================
|
|
235
|
+
|
|
236
|
+
@doc("Filter parameters for querying profiles")
|
|
237
|
+
model ProfileQueryFilters {
|
|
238
|
+
@doc("Filter by trace ID")
|
|
239
|
+
@query
|
|
240
|
+
@encodedName("application/json", "trace_id")
|
|
241
|
+
traceId?: TraceId;
|
|
242
|
+
|
|
243
|
+
@doc("Filter by span ID")
|
|
244
|
+
@query
|
|
245
|
+
@encodedName("application/json", "span_id")
|
|
246
|
+
spanId?: SpanId;
|
|
247
|
+
|
|
248
|
+
@doc("Filter by session ID")
|
|
249
|
+
@query
|
|
250
|
+
@encodedName("application/json", "session_id")
|
|
251
|
+
sessionId?: SessionId;
|
|
252
|
+
|
|
253
|
+
@doc("Filter by service name")
|
|
254
|
+
@query
|
|
255
|
+
@encodedName("application/json", "service_name")
|
|
256
|
+
serviceName?: string;
|
|
257
|
+
|
|
258
|
+
@doc("Filter by sample type (e.g., cpu, alloc_objects, wall)")
|
|
259
|
+
@query
|
|
260
|
+
@encodedName("application/json", "sample_type")
|
|
261
|
+
sampleType?: string;
|
|
262
|
+
|
|
263
|
+
@doc("Filter by profile frame type (e.g., dotnet, jvm, cpython)")
|
|
264
|
+
@query
|
|
265
|
+
@encodedName("application/json", "profile_frame_type")
|
|
266
|
+
profileFrameType?: string;
|
|
267
|
+
|
|
268
|
+
@doc("Filter by original payload format")
|
|
269
|
+
@query
|
|
270
|
+
@encodedName("application/json", "original_payload_format")
|
|
271
|
+
originalPayloadFormat?: OriginalPayloadFormat;
|
|
272
|
+
|
|
273
|
+
@doc("Minimum duration in nanoseconds")
|
|
274
|
+
@query
|
|
275
|
+
@encodedName("application/json", "min_duration_nano")
|
|
276
|
+
minDurationNano?: DurationNs;
|
|
277
|
+
|
|
278
|
+
@doc("Start of time range (inclusive, ISO 8601)")
|
|
279
|
+
@query
|
|
280
|
+
@encodedName("application/json", "time_from")
|
|
281
|
+
timeFrom?: utcDateTime;
|
|
282
|
+
|
|
283
|
+
@doc("End of time range (exclusive, ISO 8601)")
|
|
284
|
+
@query
|
|
285
|
+
@encodedName("application/json", "time_to")
|
|
286
|
+
timeTo?: utcDateTime;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// =============================================================================
|
|
290
|
+
// Profile Aggregations
|
|
291
|
+
// =============================================================================
|
|
292
|
+
|
|
293
|
+
@doc("Aggregated profile statistics")
|
|
294
|
+
model ProfileStats {
|
|
295
|
+
@doc("Total profile count")
|
|
296
|
+
@encodedName("application/json", "total_count")
|
|
297
|
+
totalCount: Count;
|
|
298
|
+
|
|
299
|
+
@doc("Total sample count across all profiles")
|
|
300
|
+
@encodedName("application/json", "total_sample_count")
|
|
301
|
+
totalSampleCount: Count;
|
|
302
|
+
|
|
303
|
+
@doc("Average duration in nanoseconds")
|
|
304
|
+
@encodedName("application/json", "avg_duration_nano")
|
|
305
|
+
avgDurationNano: float64;
|
|
306
|
+
|
|
307
|
+
@doc("Stats grouped by sample type")
|
|
308
|
+
@encodedName("application/json", "by_sample_type")
|
|
309
|
+
bySampleType?: ProfileStatsByDimension[];
|
|
310
|
+
|
|
311
|
+
@doc("Stats grouped by service")
|
|
312
|
+
@encodedName("application/json", "by_service")
|
|
313
|
+
byService?: ProfileStatsByDimension[];
|
|
314
|
+
|
|
315
|
+
@doc("Stats grouped by frame type")
|
|
316
|
+
@encodedName("application/json", "by_frame_type")
|
|
317
|
+
byFrameType?: ProfileStatsByDimension[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@doc("Profile statistics for a specific dimension value")
|
|
321
|
+
model ProfileStatsByDimension {
|
|
322
|
+
@doc("Dimension value")
|
|
323
|
+
dimension: string;
|
|
324
|
+
|
|
325
|
+
@doc("Profile count for this dimension")
|
|
326
|
+
count: Count;
|
|
327
|
+
|
|
328
|
+
@doc("Total sample count for this dimension")
|
|
329
|
+
@encodedName("application/json", "sample_count")
|
|
330
|
+
sampleCount: Count;
|
|
331
|
+
|
|
332
|
+
@doc("Average duration in nanoseconds")
|
|
333
|
+
@encodedName("application/json", "avg_duration_nano")
|
|
334
|
+
avgDurationNano: float64;
|
|
335
|
+
}
|