@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/models/http.tsp
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ANcpLua v2.0 - HTTP Semantic Conventions (OTel v1.40)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// HTTP client and server telemetry attributes following OTel specifications.
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
import "@typespec/versioning";
|
|
8
|
+
import "../common/types.tsp";
|
|
9
|
+
|
|
10
|
+
using TypeSpec.Versioning;
|
|
11
|
+
using Qyl.Api.Contracts.Common;
|
|
12
|
+
|
|
13
|
+
@versioned(HttpVersions)
|
|
14
|
+
namespace Qyl.Api.Contracts.Domains.Transport.Http;
|
|
15
|
+
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// Version History
|
|
18
|
+
// =============================================================================
|
|
19
|
+
|
|
20
|
+
@doc("HTTP semantic convention versions")
|
|
21
|
+
enum HttpVersions {
|
|
22
|
+
@doc("Legacy HTTP semconv")
|
|
23
|
+
v1_20: "1.20.0",
|
|
24
|
+
|
|
25
|
+
@doc("Stable HTTP semconv")
|
|
26
|
+
v1_23: "1.23.0",
|
|
27
|
+
|
|
28
|
+
@doc("HTTP semconv v1.38")
|
|
29
|
+
v1_38: "1.38.0",
|
|
30
|
+
|
|
31
|
+
@doc("Current HTTP semconv")
|
|
32
|
+
v1_39: "1.39.0",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// HTTP Span Attributes (Complete OTel v1.40)
|
|
37
|
+
// =============================================================================
|
|
38
|
+
|
|
39
|
+
@doc("HTTP span attributes following OTel Semantic Conventions v1.40")
|
|
40
|
+
model HttpAttributes {
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Common Attributes (Client & Server)
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
@doc("HTTP request method")
|
|
46
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestMethod)
|
|
47
|
+
requestMethod: HttpMethod;
|
|
48
|
+
|
|
49
|
+
@doc("Original HTTP method (before any rewrites)")
|
|
50
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestMethodOriginal)
|
|
51
|
+
requestMethodOriginal?: string;
|
|
52
|
+
|
|
53
|
+
@doc("HTTP response status code")
|
|
54
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseStatusCode)
|
|
55
|
+
@minValue(100)
|
|
56
|
+
@maxValue(599)
|
|
57
|
+
responseStatusCode?: int32;
|
|
58
|
+
|
|
59
|
+
@doc("Error type if request failed")
|
|
60
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Error.Type)
|
|
61
|
+
errorType?: HttpErrorType;
|
|
62
|
+
|
|
63
|
+
@doc("HTTP protocol version")
|
|
64
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Network.ProtocolVersion)
|
|
65
|
+
networkProtocolVersion?: HttpProtocolVersion;
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Server-Side Attributes
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
@doc("The matched route template (e.g., '/users/{userId}')")
|
|
72
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Route)
|
|
73
|
+
route?: string;
|
|
74
|
+
|
|
75
|
+
@doc("Server address (hostname or IP)")
|
|
76
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Server.Address)
|
|
77
|
+
serverAddress?: string;
|
|
78
|
+
|
|
79
|
+
@doc("Server port")
|
|
80
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Server.Port)
|
|
81
|
+
serverPort?: Port;
|
|
82
|
+
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Client-Side Attributes
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
@doc("Full request target URL")
|
|
88
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Full)
|
|
89
|
+
urlFull?: UrlString;
|
|
90
|
+
|
|
91
|
+
@doc("URL path component")
|
|
92
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Path)
|
|
93
|
+
urlPath?: UrlPath;
|
|
94
|
+
|
|
95
|
+
@doc("URL query string (without leading ?)")
|
|
96
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Query)
|
|
97
|
+
urlQuery?: UrlQuery;
|
|
98
|
+
|
|
99
|
+
@doc("URL scheme (http or https)")
|
|
100
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Scheme)
|
|
101
|
+
urlScheme?: UrlScheme;
|
|
102
|
+
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Request Attributes
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
|
|
107
|
+
@doc("Size of the request body in bytes")
|
|
108
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestBodySize)
|
|
109
|
+
requestBodySize?: ByteSize;
|
|
110
|
+
|
|
111
|
+
@doc("Request content length header value")
|
|
112
|
+
@encodedName("application/json", "http.request.header.content-length")
|
|
113
|
+
requestContentLength?: ByteSize;
|
|
114
|
+
|
|
115
|
+
@doc("Request content type header")
|
|
116
|
+
@encodedName("application/json", "http.request.header.content-type")
|
|
117
|
+
requestContentType?: ContentType;
|
|
118
|
+
|
|
119
|
+
@doc("Request User-Agent header")
|
|
120
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.UserAgent.Original)
|
|
121
|
+
userAgentOriginal?: UserAgent;
|
|
122
|
+
|
|
123
|
+
@doc("Request Accept header")
|
|
124
|
+
@encodedName("application/json", "http.request.header.accept")
|
|
125
|
+
requestAccept?: string;
|
|
126
|
+
|
|
127
|
+
@doc("Request Authorization scheme (e.g., 'Bearer')")
|
|
128
|
+
@encodedName("application/json", "http.request.header.authorization")
|
|
129
|
+
requestAuthorizationScheme?: string;
|
|
130
|
+
|
|
131
|
+
@doc("Request X-Forwarded-For header")
|
|
132
|
+
@encodedName("application/json", "http.request.header.x-forwarded-for")
|
|
133
|
+
requestXForwardedFor?: string;
|
|
134
|
+
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Response Attributes
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
@doc("Size of the response body in bytes")
|
|
140
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseBodySize)
|
|
141
|
+
responseBodySize?: ByteSize;
|
|
142
|
+
|
|
143
|
+
@doc("Response content length header value")
|
|
144
|
+
@encodedName("application/json", "http.response.header.content-length")
|
|
145
|
+
responseContentLength?: ByteSize;
|
|
146
|
+
|
|
147
|
+
@doc("Response content type header")
|
|
148
|
+
@encodedName("application/json", "http.response.header.content-type")
|
|
149
|
+
responseContentType?: ContentType;
|
|
150
|
+
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Template Headers (Dynamic Keys: http.request.header.<key>)
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
@doc("HTTP request headers. Keys map to http.request.header.<key>")
|
|
156
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestHeader)
|
|
157
|
+
requestHeaders?: Record<string[]>;
|
|
158
|
+
|
|
159
|
+
@doc("HTTP response headers. Keys map to http.response.header.<key>")
|
|
160
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseHeader)
|
|
161
|
+
responseHeaders?: Record<string[]>;
|
|
162
|
+
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
// Client IP Attributes (Server-Side)
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
@doc("Client address (IP, hostname, or Unix socket path)")
|
|
168
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Client.Address)
|
|
169
|
+
clientAddress?: IpAddress | string;
|
|
170
|
+
|
|
171
|
+
@doc("Client port")
|
|
172
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Client.Port)
|
|
173
|
+
clientPort?: Port;
|
|
174
|
+
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
// Connection Attributes
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
@doc("State of the HTTP connection")
|
|
180
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ConnectionState)
|
|
181
|
+
connectionState?: HttpConnectionState;
|
|
182
|
+
|
|
183
|
+
@doc("Number of retries for the request")
|
|
184
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestResendCount)
|
|
185
|
+
requestResendCount?: int32;
|
|
186
|
+
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
// Deprecated Attributes (for migration)
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
|
|
191
|
+
@doc("Request target (deprecated - use url.path + url.query)")
|
|
192
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Target)
|
|
193
|
+
@removed(HttpVersions.v1_23)
|
|
194
|
+
target?: string;
|
|
195
|
+
|
|
196
|
+
@doc("Request URL (deprecated - use url.full)")
|
|
197
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Url)
|
|
198
|
+
@removed(HttpVersions.v1_23)
|
|
199
|
+
url?: UrlString;
|
|
200
|
+
|
|
201
|
+
@doc("HTTP method (deprecated - use http.request.method)")
|
|
202
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Method)
|
|
203
|
+
@removed(HttpVersions.v1_23)
|
|
204
|
+
method?: string;
|
|
205
|
+
|
|
206
|
+
@doc("Status code (deprecated - use http.response.status_code)")
|
|
207
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.StatusCode)
|
|
208
|
+
@removed(HttpVersions.v1_23)
|
|
209
|
+
statusCode?: int32;
|
|
210
|
+
|
|
211
|
+
@doc("Request content length (deprecated)")
|
|
212
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestContentLength)
|
|
213
|
+
@removed(HttpVersions.v1_23)
|
|
214
|
+
requestContentLengthLegacy?: ByteSize;
|
|
215
|
+
|
|
216
|
+
@doc("Response content length (deprecated)")
|
|
217
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseContentLength)
|
|
218
|
+
@removed(HttpVersions.v1_23)
|
|
219
|
+
responseContentLengthLegacy?: ByteSize;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// =============================================================================
|
|
223
|
+
// HTTP Enumerations
|
|
224
|
+
// =============================================================================
|
|
225
|
+
|
|
226
|
+
@doc("Standard HTTP request methods")
|
|
227
|
+
enum HttpMethod {
|
|
228
|
+
@doc("GET method - retrieve resource")
|
|
229
|
+
GET: "GET",
|
|
230
|
+
|
|
231
|
+
@doc("HEAD method - retrieve headers only")
|
|
232
|
+
HEAD: "HEAD",
|
|
233
|
+
|
|
234
|
+
@doc("POST method - create resource")
|
|
235
|
+
POST: "POST",
|
|
236
|
+
|
|
237
|
+
@doc("PUT method - replace resource")
|
|
238
|
+
PUT: "PUT",
|
|
239
|
+
|
|
240
|
+
@doc("DELETE method - remove resource")
|
|
241
|
+
DELETE: "DELETE",
|
|
242
|
+
|
|
243
|
+
@doc("CONNECT method - establish tunnel")
|
|
244
|
+
CONNECT: "CONNECT",
|
|
245
|
+
|
|
246
|
+
@doc("OPTIONS method - describe options")
|
|
247
|
+
OPTIONS: "OPTIONS",
|
|
248
|
+
|
|
249
|
+
@doc("TRACE method - diagnostic trace")
|
|
250
|
+
TRACE: "TRACE",
|
|
251
|
+
|
|
252
|
+
@doc("PATCH method - partial update")
|
|
253
|
+
PATCH: "PATCH",
|
|
254
|
+
|
|
255
|
+
@doc("Custom/other method (use _OTHER)")
|
|
256
|
+
OTHER: "_OTHER",
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@doc("HTTP protocol versions")
|
|
260
|
+
enum HttpProtocolVersion {
|
|
261
|
+
@doc("HTTP/1.0")
|
|
262
|
+
http10: "1.0",
|
|
263
|
+
|
|
264
|
+
@doc("HTTP/1.1")
|
|
265
|
+
http11: "1.1",
|
|
266
|
+
|
|
267
|
+
@doc("HTTP/2")
|
|
268
|
+
http2: "2",
|
|
269
|
+
|
|
270
|
+
@doc("HTTP/3 (QUIC)")
|
|
271
|
+
http3: "3",
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@doc("URL schemes")
|
|
275
|
+
enum UrlScheme {
|
|
276
|
+
@doc("Unencrypted HTTP")
|
|
277
|
+
http: "http",
|
|
278
|
+
|
|
279
|
+
@doc("TLS-encrypted HTTPS")
|
|
280
|
+
https: "https",
|
|
281
|
+
|
|
282
|
+
@doc("WebSocket")
|
|
283
|
+
ws: "ws",
|
|
284
|
+
|
|
285
|
+
@doc("Secure WebSocket")
|
|
286
|
+
wss: "wss",
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@doc("HTTP connection state")
|
|
290
|
+
enum HttpConnectionState {
|
|
291
|
+
@doc("Connection is active")
|
|
292
|
+
active: "active",
|
|
293
|
+
|
|
294
|
+
@doc("Connection is idle")
|
|
295
|
+
idle: "idle",
|
|
296
|
+
|
|
297
|
+
@doc("Connection is closing")
|
|
298
|
+
closing: "closing",
|
|
299
|
+
|
|
300
|
+
@doc("Connection is closed")
|
|
301
|
+
closed: "closed",
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@doc("HTTP error types")
|
|
305
|
+
enum HttpErrorType {
|
|
306
|
+
@doc("Timeout waiting for response")
|
|
307
|
+
timeout: "TIMEOUT",
|
|
308
|
+
|
|
309
|
+
@doc("Connection refused")
|
|
310
|
+
connectionRefused: "CONNECTION_REFUSED",
|
|
311
|
+
|
|
312
|
+
@doc("Host not found (DNS error)")
|
|
313
|
+
hostNotFound: "HOST_NOT_FOUND",
|
|
314
|
+
|
|
315
|
+
@doc("SSL/TLS error")
|
|
316
|
+
sslError: "SSL_ERROR",
|
|
317
|
+
|
|
318
|
+
@doc("Connection reset")
|
|
319
|
+
connectionReset: "CONNECTION_RESET",
|
|
320
|
+
|
|
321
|
+
@doc("Network unreachable")
|
|
322
|
+
networkUnreachable: "NETWORK_UNREACHABLE",
|
|
323
|
+
|
|
324
|
+
@doc("Request cancelled")
|
|
325
|
+
cancelled: "CANCELLED",
|
|
326
|
+
|
|
327
|
+
@doc("Request too large")
|
|
328
|
+
requestTooLarge: "REQUEST_TOO_LARGE",
|
|
329
|
+
|
|
330
|
+
@doc("Response too large")
|
|
331
|
+
responseTooLarge: "RESPONSE_TOO_LARGE",
|
|
332
|
+
|
|
333
|
+
@doc("Invalid response")
|
|
334
|
+
invalidResponse: "INVALID_RESPONSE",
|
|
335
|
+
|
|
336
|
+
@doc("Too many redirects")
|
|
337
|
+
tooManyRedirects: "TOO_MANY_REDIRECTS",
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@doc("HTTP status code ranges")
|
|
341
|
+
enum HttpStatusClass {
|
|
342
|
+
@doc("1xx Informational")
|
|
343
|
+
informational: "1xx",
|
|
344
|
+
|
|
345
|
+
@doc("2xx Success")
|
|
346
|
+
success: "2xx",
|
|
347
|
+
|
|
348
|
+
@doc("3xx Redirection")
|
|
349
|
+
redirection: "3xx",
|
|
350
|
+
|
|
351
|
+
@doc("4xx Client Error")
|
|
352
|
+
clientError: "4xx",
|
|
353
|
+
|
|
354
|
+
@doc("5xx Server Error")
|
|
355
|
+
serverError: "5xx",
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// =============================================================================
|
|
359
|
+
// HTTP Request/Response Models
|
|
360
|
+
// =============================================================================
|
|
361
|
+
|
|
362
|
+
@doc("Complete HTTP request record")
|
|
363
|
+
model HttpRequest {
|
|
364
|
+
@doc("Request method")
|
|
365
|
+
method: HttpMethod;
|
|
366
|
+
|
|
367
|
+
@doc("Full URL")
|
|
368
|
+
url: UrlString;
|
|
369
|
+
|
|
370
|
+
@doc("URL path")
|
|
371
|
+
path: UrlPath;
|
|
372
|
+
|
|
373
|
+
@doc("URL query string")
|
|
374
|
+
query?: UrlQuery;
|
|
375
|
+
|
|
376
|
+
@doc("Request headers")
|
|
377
|
+
headers: HttpHeader[];
|
|
378
|
+
|
|
379
|
+
@doc("Request body size in bytes")
|
|
380
|
+
@encodedName("application/json", "body_size")
|
|
381
|
+
bodySize?: ByteSize;
|
|
382
|
+
|
|
383
|
+
@doc("Request body hash (for deduplication)")
|
|
384
|
+
@encodedName("application/json", "body_hash")
|
|
385
|
+
bodyHash?: Sha256Hash;
|
|
386
|
+
|
|
387
|
+
@doc("Protocol version")
|
|
388
|
+
@encodedName("application/json", "protocol_version")
|
|
389
|
+
protocolVersion: HttpProtocolVersion;
|
|
390
|
+
|
|
391
|
+
@doc("Request timestamp")
|
|
392
|
+
timestamp: utcDateTime;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@doc("Complete HTTP response record")
|
|
396
|
+
model HttpResponse {
|
|
397
|
+
@doc("Status code")
|
|
398
|
+
@encodedName("application/json", "status_code")
|
|
399
|
+
statusCode: int32;
|
|
400
|
+
|
|
401
|
+
@doc("Status text")
|
|
402
|
+
@encodedName("application/json", "status_text")
|
|
403
|
+
statusText?: string;
|
|
404
|
+
|
|
405
|
+
@doc("Response headers")
|
|
406
|
+
headers: HttpHeader[];
|
|
407
|
+
|
|
408
|
+
@doc("Response body size in bytes")
|
|
409
|
+
@encodedName("application/json", "body_size")
|
|
410
|
+
bodySize?: ByteSize;
|
|
411
|
+
|
|
412
|
+
@doc("Response timestamp")
|
|
413
|
+
timestamp: utcDateTime;
|
|
414
|
+
|
|
415
|
+
@doc("Time to first byte in milliseconds")
|
|
416
|
+
@encodedName("application/json", "ttfb_ms")
|
|
417
|
+
ttfbMs?: DurationMs;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@doc("HTTP header key-value pair")
|
|
421
|
+
model HttpHeader {
|
|
422
|
+
@doc("Header name (case-insensitive)")
|
|
423
|
+
name: string;
|
|
424
|
+
|
|
425
|
+
@doc("Header value(s)")
|
|
426
|
+
value: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// =============================================================================
|
|
430
|
+
// HTTP Metrics
|
|
431
|
+
// =============================================================================
|
|
432
|
+
|
|
433
|
+
@doc("HTTP server request duration metric")
|
|
434
|
+
model HttpServerRequestDurationMetric {
|
|
435
|
+
@doc("Metric name")
|
|
436
|
+
name: "http.server.request.duration";
|
|
437
|
+
|
|
438
|
+
@doc("Metric unit (seconds)")
|
|
439
|
+
unit: "s";
|
|
440
|
+
|
|
441
|
+
@doc("HTTP method")
|
|
442
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestMethod)
|
|
443
|
+
requestMethod: HttpMethod;
|
|
444
|
+
|
|
445
|
+
@doc("HTTP route")
|
|
446
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Route)
|
|
447
|
+
route: string;
|
|
448
|
+
|
|
449
|
+
@doc("Response status code")
|
|
450
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseStatusCode)
|
|
451
|
+
responseStatusCode: int32;
|
|
452
|
+
|
|
453
|
+
@doc("URL scheme")
|
|
454
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Scheme)
|
|
455
|
+
urlScheme: UrlScheme;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
@doc("HTTP server active requests metric")
|
|
459
|
+
model HttpServerActiveRequestsMetric {
|
|
460
|
+
@doc("Metric name")
|
|
461
|
+
name: "http.server.active_requests";
|
|
462
|
+
|
|
463
|
+
@doc("Metric unit")
|
|
464
|
+
unit: "{request}";
|
|
465
|
+
|
|
466
|
+
@doc("HTTP method")
|
|
467
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestMethod)
|
|
468
|
+
requestMethod: HttpMethod;
|
|
469
|
+
|
|
470
|
+
@doc("HTTP route")
|
|
471
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Route)
|
|
472
|
+
route?: string;
|
|
473
|
+
|
|
474
|
+
@doc("URL scheme")
|
|
475
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Url.Scheme)
|
|
476
|
+
urlScheme: UrlScheme;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
@doc("HTTP client request duration metric")
|
|
480
|
+
model HttpClientRequestDurationMetric {
|
|
481
|
+
@doc("Metric name")
|
|
482
|
+
name: "http.client.request.duration";
|
|
483
|
+
|
|
484
|
+
@doc("Metric unit (seconds)")
|
|
485
|
+
unit: "s";
|
|
486
|
+
|
|
487
|
+
@doc("HTTP method")
|
|
488
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestMethod)
|
|
489
|
+
requestMethod: HttpMethod;
|
|
490
|
+
|
|
491
|
+
@doc("Server address")
|
|
492
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Server.Address)
|
|
493
|
+
serverAddress: string;
|
|
494
|
+
|
|
495
|
+
@doc("Server port")
|
|
496
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Server.Port)
|
|
497
|
+
serverPort: Port;
|
|
498
|
+
|
|
499
|
+
@doc("Response status code")
|
|
500
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseStatusCode)
|
|
501
|
+
responseStatusCode?: int32;
|
|
502
|
+
|
|
503
|
+
@doc("Error type if failed")
|
|
504
|
+
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Error.Type)
|
|
505
|
+
errorType?: HttpErrorType;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// =============================================================================
|
|
509
|
+
// HTTP Statistics
|
|
510
|
+
// =============================================================================
|
|
511
|
+
|
|
512
|
+
@doc("Aggregated HTTP statistics")
|
|
513
|
+
model HttpStats {
|
|
514
|
+
@doc("Total request count")
|
|
515
|
+
@encodedName("application/json", "total_requests")
|
|
516
|
+
totalRequests: Count;
|
|
517
|
+
|
|
518
|
+
@doc("Successful request count (2xx)")
|
|
519
|
+
@encodedName("application/json", "success_count")
|
|
520
|
+
successCount: Count;
|
|
521
|
+
|
|
522
|
+
@doc("Client error count (4xx)")
|
|
523
|
+
@encodedName("application/json", "client_error_count")
|
|
524
|
+
clientErrorCount: Count;
|
|
525
|
+
|
|
526
|
+
@doc("Server error count (5xx)")
|
|
527
|
+
@encodedName("application/json", "server_error_count")
|
|
528
|
+
serverErrorCount: Count;
|
|
529
|
+
|
|
530
|
+
@doc("Error rate (4xx + 5xx / total)")
|
|
531
|
+
@encodedName("application/json", "error_rate")
|
|
532
|
+
errorRate: Ratio;
|
|
533
|
+
|
|
534
|
+
@doc("Average duration in milliseconds")
|
|
535
|
+
@encodedName("application/json", "avg_duration_ms")
|
|
536
|
+
avgDurationMs: float64;
|
|
537
|
+
|
|
538
|
+
@doc("P50 duration in milliseconds")
|
|
539
|
+
@encodedName("application/json", "p50_duration_ms")
|
|
540
|
+
p50DurationMs: float64;
|
|
541
|
+
|
|
542
|
+
@doc("P95 duration in milliseconds")
|
|
543
|
+
@encodedName("application/json", "p95_duration_ms")
|
|
544
|
+
p95DurationMs: float64;
|
|
545
|
+
|
|
546
|
+
@doc("P99 duration in milliseconds")
|
|
547
|
+
@encodedName("application/json", "p99_duration_ms")
|
|
548
|
+
p99DurationMs: float64;
|
|
549
|
+
|
|
550
|
+
@doc("Requests per second")
|
|
551
|
+
@encodedName("application/json", "requests_per_second")
|
|
552
|
+
requestsPerSecond: float64;
|
|
553
|
+
|
|
554
|
+
@doc("Total bytes received")
|
|
555
|
+
@encodedName("application/json", "total_bytes_received")
|
|
556
|
+
totalBytesReceived: ByteSize;
|
|
557
|
+
|
|
558
|
+
@doc("Total bytes sent")
|
|
559
|
+
@encodedName("application/json", "total_bytes_sent")
|
|
560
|
+
totalBytesSent: ByteSize;
|
|
561
|
+
|
|
562
|
+
@doc("Stats by route")
|
|
563
|
+
@encodedName("application/json", "by_route")
|
|
564
|
+
byRoute?: HttpRouteStats[];
|
|
565
|
+
|
|
566
|
+
@doc("Stats by status code")
|
|
567
|
+
@encodedName("application/json", "by_status_code")
|
|
568
|
+
byStatusCode?: HttpStatusStats[];
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
@doc("HTTP statistics by route")
|
|
572
|
+
model HttpRouteStats {
|
|
573
|
+
@doc("Route template")
|
|
574
|
+
route: string;
|
|
575
|
+
|
|
576
|
+
@doc("Request count")
|
|
577
|
+
@encodedName("application/json", "request_count")
|
|
578
|
+
requestCount: Count;
|
|
579
|
+
|
|
580
|
+
@doc("Average duration in milliseconds")
|
|
581
|
+
@encodedName("application/json", "avg_duration_ms")
|
|
582
|
+
avgDurationMs: float64;
|
|
583
|
+
|
|
584
|
+
@doc("Error rate")
|
|
585
|
+
@encodedName("application/json", "error_rate")
|
|
586
|
+
errorRate: Ratio;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
@doc("HTTP statistics by status code")
|
|
590
|
+
model HttpStatusStats {
|
|
591
|
+
@doc("Status code")
|
|
592
|
+
@encodedName("application/json", "status_code")
|
|
593
|
+
statusCode: int32;
|
|
594
|
+
|
|
595
|
+
@doc("Request count")
|
|
596
|
+
count: Count;
|
|
597
|
+
|
|
598
|
+
@doc("Percentage of total")
|
|
599
|
+
percentage: Percentage;
|
|
600
|
+
}
|