Initial Commit
This commit is contained in:
21
packages/api-stack/api/api-manifest/src/schema/telemetry.ts
Normal file
21
packages/api-stack/api/api-manifest/src/schema/telemetry.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import z from "zod";
|
||||
|
||||
/**
|
||||
* Telemetry-instrument declarations. The host pre-registers each named
|
||||
* counter/histogram/gauge so plugin code can emit without first
|
||||
* round-tripping through a registration call.
|
||||
*/
|
||||
const instrumentSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
labels: z.array(z.string().min(1)).readonly().optional(),
|
||||
});
|
||||
|
||||
export const telemetrySchema = z.object({
|
||||
metricPrefix: z.string().min(1).optional(),
|
||||
spanPrefix: z.string().min(1).optional(),
|
||||
counters: z.array(instrumentSchema).readonly().optional(),
|
||||
histograms: z.array(instrumentSchema).readonly().optional(),
|
||||
gauges: z.array(instrumentSchema).readonly().optional(),
|
||||
});
|
||||
|
||||
export type Telemetry = z.infer<typeof telemetrySchema>;
|
||||
Reference in New Issue
Block a user