@ancplua/qyl-api-schema 0.5.13 → 0.5.15
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/api/routes.tsp +155 -50
- package/generated/json-schema/qyl-api-schema.json +2407 -381
- package/generated/openapi/qyl.openapi.json +2636 -380
- package/generated/ts-runtime/api.d.ts +333 -38
- package/generated/ts-runtime/api.js +51 -13
- package/index.tsp +1 -0
- package/models/cost-etl-audit.tsp +600 -83
- package/otel/enums.tsp +0 -3
- package/otel/metrics.tsp +215 -0
- package/otel/otel-conventions.tsp +1 -0
- package/package.json +3 -2
package/otel/enums.tsp
CHANGED
package/otel/metrics.tsp
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// OpenTelemetry metric data-point JSON projection
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// The collector receives the official OTLP protobuf contract. This model is the
|
|
5
|
+
// generated client-facing projection returned by the Qyl product API.
|
|
6
|
+
// =============================================================================
|
|
7
|
+
|
|
8
|
+
import "@typespec/openapi";
|
|
9
|
+
import "../common/types.tsp";
|
|
10
|
+
import "./enums.tsp";
|
|
11
|
+
import "./resource.tsp";
|
|
12
|
+
|
|
13
|
+
using TypeSpec.OpenAPI;
|
|
14
|
+
using Qyl.Api.Contracts.Common;
|
|
15
|
+
using Qyl.Api.Contracts.OTel.Enums;
|
|
16
|
+
|
|
17
|
+
namespace Qyl.Api.Contracts.OTel.Metrics;
|
|
18
|
+
|
|
19
|
+
@doc("An OTLP signed 64-bit metric integer encoded as a decimal JSON string.")
|
|
20
|
+
@encode(string)
|
|
21
|
+
@TypeSpec.OpenAPI.extension("x-csharp-type", "long")
|
|
22
|
+
scalar MetricInt64 extends int64;
|
|
23
|
+
|
|
24
|
+
@doc("An OTLP unsigned 64-bit metric count encoded as a decimal JSON string.")
|
|
25
|
+
@encode(string)
|
|
26
|
+
@TypeSpec.OpenAPI.extension("x-csharp-type", "ulong")
|
|
27
|
+
scalar MetricUInt64 extends uint64;
|
|
28
|
+
|
|
29
|
+
@doc("A non-zero OTLP metric or exemplar timestamp in Unix nanoseconds.")
|
|
30
|
+
@encode(string)
|
|
31
|
+
@minValue(1)
|
|
32
|
+
@TypeSpec.OpenAPI.extension("x-csharp-type", "ulong")
|
|
33
|
+
scalar MetricUnixNanos extends uint64;
|
|
34
|
+
|
|
35
|
+
@doc("An optional OTLP metric start timestamp in Unix nanoseconds, encoded as a decimal JSON string.")
|
|
36
|
+
@encode(string)
|
|
37
|
+
@minValue(0)
|
|
38
|
+
@TypeSpec.OpenAPI.extension("x-csharp-type", "ulong")
|
|
39
|
+
scalar MetricStartUnixNanos extends uint64;
|
|
40
|
+
|
|
41
|
+
@doc("An integer measurement value from an OTLP number data point or exemplar.")
|
|
42
|
+
model MetricIntegerValue {
|
|
43
|
+
@encodedName("application/json", "as_int")
|
|
44
|
+
asInt: MetricInt64;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@doc("A floating-point measurement value from an OTLP number data point or exemplar.")
|
|
48
|
+
model MetricDoubleValue {
|
|
49
|
+
@encodedName("application/json", "as_double")
|
|
50
|
+
asDouble: float64;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@doc("The exactly-one numeric value carried by an OTLP number data point or exemplar.")
|
|
54
|
+
union MetricNumberValue {
|
|
55
|
+
integer: MetricIntegerValue,
|
|
56
|
+
double: MetricDoubleValue,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@doc("A sampled measurement linked to the trace or span active when it was recorded.")
|
|
60
|
+
model MetricExemplar {
|
|
61
|
+
@encodedName("application/json", "time_unix_nano")
|
|
62
|
+
timeUnixNano: MetricUnixNanos;
|
|
63
|
+
|
|
64
|
+
value: MetricNumberValue;
|
|
65
|
+
|
|
66
|
+
@encodedName("application/json", "span_id")
|
|
67
|
+
spanId?: SpanId;
|
|
68
|
+
|
|
69
|
+
@encodedName("application/json", "trace_id")
|
|
70
|
+
traceId?: TraceId;
|
|
71
|
+
|
|
72
|
+
@encodedName("application/json", "filtered_attributes")
|
|
73
|
+
filteredAttributes?: Attribute[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@doc("Bucket range used by an OTLP exponential histogram data point.")
|
|
77
|
+
model ExponentialHistogramBuckets {
|
|
78
|
+
@doc("Index of the first bucket count.")
|
|
79
|
+
offset: int32;
|
|
80
|
+
|
|
81
|
+
@encodedName("application/json", "bucket_counts")
|
|
82
|
+
bucketCounts: MetricUInt64[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@doc("A quantile and value reported by an OTLP summary data point.")
|
|
86
|
+
model SummaryQuantileValue {
|
|
87
|
+
@minValue(0)
|
|
88
|
+
@maxValue(1)
|
|
89
|
+
quantile: float64;
|
|
90
|
+
|
|
91
|
+
@minValue(0)
|
|
92
|
+
value: float64;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@doc("Fields shared by every persisted OTLP metric data point.")
|
|
96
|
+
model MetricPointBase {
|
|
97
|
+
@doc("Metric stream name.")
|
|
98
|
+
@minLength(1)
|
|
99
|
+
name: string;
|
|
100
|
+
|
|
101
|
+
description?: string;
|
|
102
|
+
unit?: string;
|
|
103
|
+
|
|
104
|
+
@doc("Non-identifying metadata attached to the OTLP metric descriptor.")
|
|
105
|
+
metadata?: Attribute[];
|
|
106
|
+
|
|
107
|
+
@doc("Attributes identifying this metric time series.")
|
|
108
|
+
attributes?: Attribute[];
|
|
109
|
+
|
|
110
|
+
@encodedName("application/json", "start_time_unix_nano")
|
|
111
|
+
startTimeUnixNano: MetricStartUnixNanos;
|
|
112
|
+
|
|
113
|
+
@encodedName("application/json", "time_unix_nano")
|
|
114
|
+
timeUnixNano: MetricUnixNanos;
|
|
115
|
+
|
|
116
|
+
@doc("OTLP data-point flags preserved as an extensible bit field.")
|
|
117
|
+
flags: uint32;
|
|
118
|
+
|
|
119
|
+
@doc("Resource describing the entity that produced the metric.")
|
|
120
|
+
resource: Qyl.Api.Contracts.OTel.Resource.Resource;
|
|
121
|
+
|
|
122
|
+
@encodedName("application/json", "resource_schema_url")
|
|
123
|
+
resourceSchemaUrl?: string;
|
|
124
|
+
|
|
125
|
+
@encodedName("application/json", "instrumentation_scope")
|
|
126
|
+
instrumentationScope?: InstrumentationScope;
|
|
127
|
+
|
|
128
|
+
@encodedName("application/json", "scope_schema_url")
|
|
129
|
+
scopeSchemaUrl?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@doc("Instantaneous gauge measurement.")
|
|
133
|
+
model GaugeMetricPoint extends MetricPointBase {
|
|
134
|
+
type: "gauge";
|
|
135
|
+
value: MetricNumberValue;
|
|
136
|
+
exemplars?: MetricExemplar[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@doc("Delta or cumulative sum measurement.")
|
|
140
|
+
model SumMetricPoint extends MetricPointBase {
|
|
141
|
+
type: "sum";
|
|
142
|
+
value: MetricNumberValue;
|
|
143
|
+
|
|
144
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
145
|
+
aggregationTemporality: AggregationTemporality;
|
|
146
|
+
|
|
147
|
+
@encodedName("application/json", "is_monotonic")
|
|
148
|
+
isMonotonic: boolean;
|
|
149
|
+
|
|
150
|
+
exemplars?: MetricExemplar[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@doc("Explicit-bucket histogram measurement.")
|
|
154
|
+
model HistogramMetricPoint extends MetricPointBase {
|
|
155
|
+
type: "histogram";
|
|
156
|
+
count: MetricUInt64;
|
|
157
|
+
sum?: float64;
|
|
158
|
+
|
|
159
|
+
@encodedName("application/json", "bucket_counts")
|
|
160
|
+
bucketCounts: MetricUInt64[];
|
|
161
|
+
|
|
162
|
+
@encodedName("application/json", "explicit_bounds")
|
|
163
|
+
explicitBounds: float64[];
|
|
164
|
+
|
|
165
|
+
min?: float64;
|
|
166
|
+
max?: float64;
|
|
167
|
+
|
|
168
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
169
|
+
aggregationTemporality: AggregationTemporality;
|
|
170
|
+
|
|
171
|
+
exemplars?: MetricExemplar[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@doc("Base-2 exponential histogram measurement.")
|
|
175
|
+
model ExponentialHistogramMetricPoint extends MetricPointBase {
|
|
176
|
+
type: "exponential_histogram";
|
|
177
|
+
count: MetricUInt64;
|
|
178
|
+
sum?: float64;
|
|
179
|
+
scale: int32;
|
|
180
|
+
|
|
181
|
+
@encodedName("application/json", "zero_count")
|
|
182
|
+
zeroCount: MetricUInt64;
|
|
183
|
+
|
|
184
|
+
@encodedName("application/json", "zero_threshold")
|
|
185
|
+
zeroThreshold: float64;
|
|
186
|
+
|
|
187
|
+
positive: ExponentialHistogramBuckets;
|
|
188
|
+
negative: ExponentialHistogramBuckets;
|
|
189
|
+
min?: float64;
|
|
190
|
+
max?: float64;
|
|
191
|
+
|
|
192
|
+
@encodedName("application/json", "aggregation_temporality")
|
|
193
|
+
aggregationTemporality: AggregationTemporality;
|
|
194
|
+
|
|
195
|
+
exemplars?: MetricExemplar[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@doc("Pre-aggregated summary measurement.")
|
|
199
|
+
model SummaryMetricPoint extends MetricPointBase {
|
|
200
|
+
type: "summary";
|
|
201
|
+
count: MetricUInt64;
|
|
202
|
+
sum: float64;
|
|
203
|
+
|
|
204
|
+
@encodedName("application/json", "quantile_values")
|
|
205
|
+
quantileValues: SummaryQuantileValue[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@doc("One persisted OTLP metric data point, discriminated by aggregation kind.")
|
|
209
|
+
union MetricPoint {
|
|
210
|
+
gauge: GaugeMetricPoint,
|
|
211
|
+
sum: SumMetricPoint,
|
|
212
|
+
histogram: HistogramMetricPoint,
|
|
213
|
+
exponentialHistogram: ExponentialHistogramMetricPoint,
|
|
214
|
+
summary: SummaryMetricPoint,
|
|
215
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancplua/qyl-api-schema",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"description": "TypeSpec source of truth for qyl API contracts. Emits OpenAPI, JSON Schema, Qyl.Api.Contracts DTOs, and TypeScript contract types; not an OpenTelemetry package, storage schema, or server implementation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"models/cost-etl-audit.tsp",
|
|
62
62
|
"otel/enums.tsp",
|
|
63
63
|
"otel/logs.tsp",
|
|
64
|
+
"otel/metrics.tsp",
|
|
64
65
|
"otel/otel-conventions.tsp",
|
|
65
66
|
"otel/profiles.tsp",
|
|
66
67
|
"otel/resource.tsp",
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
"@typespec/http": "^1.13.0",
|
|
100
101
|
"@typespec/openapi": "^1.13.0",
|
|
101
102
|
"@typespec/openapi3": "^1.13.0",
|
|
102
|
-
"@typespec/sse": "
|
|
103
|
+
"@typespec/sse": ">=0.83.0 <0.85.0"
|
|
103
104
|
},
|
|
104
105
|
"peerDependenciesMeta": {
|
|
105
106
|
"@typespec/compiler": {
|