(type: Type, state: State)
| 262 | export type MetricLabel = Schema.Schema.Type<typeof MetricLabel> |
| 263 | |
| 264 | const metric = <Type extends string, State extends Schema.Constraint>(type: Type, state: State) => |
| 265 | Schema.Struct({ |
| 266 | id: Schema.String, |
| 267 | type: Schema.tag(type), |
| 268 | description: Schema.UndefinedOr(Schema.String), |
| 269 | attributes: Schema.UndefinedOr(Schema.Record(Schema.String, Schema.String)), |
| 270 | state |
| 271 | }) |
| 272 | |
| 273 | /** |
| 274 | * Schema for a counter metric snapshot, including the count and whether updates |