Variables
Const contextSchema
contextSchema: ObjectSchema = object().keys({trace_id: traceIdSchema.required(),span_id: spanIdSchema.required(),baggage: object().required()}).unknown(true).optionalKeys('baggage', 'trace_id')
Const logSchema
logSchema: ObjectSchema = object().keys({fields: object().pattern(/.+/, any()).required(),timestamp: number().required()}).optionalKeys('timestamp')
Const referenceSchema
referenceSchema: ObjectSchema = object().keys({type: string().valid(REFERENCE_CHILD_OF, REFERENCE_FOLLOWS_FROM).required(),context: contextSchema.required()})
Const spanArrSchema
spanArrSchema: ArraySchema = array().items(spanSchema.required()).min(1)
Const spanIdSchema
spanIdSchema: StringSchema = string().length(16)
Const spanReqSchema
spanReqSchema: AlternativesSchema = alternatives().try(spanSchema, spanArrSchema).required()
Const spanSchema
spanSchema: ObjectSchema = object().keys({operation: string().required(),context: contextSchema.required(),startTimeMs: number().required(),finishTimeMs: number().required().min(ref('startTimeMs')),tags: tagsSchema.required(),logs: array().items(logSchema).min(0).required(),references: array().items(referenceSchema).min(0).required()}).optionalKeys('tags', 'logs', 'references')
Const tagsSchema
tagsSchema: ObjectSchema = object().pattern(/.+/, alternatives().try(string(), boolean(), number()).required())
Const traceIdSchema
traceIdSchema: AlternativesSchema = alternatives().try(spanIdSchema, string().length(32))
This module exports a number of validation schemas that are used internally as well as by the collector to validate incoming SpanData.
This module is re-exported as a top-level export.