/** * OTLP Protobuf encoding for traces, metrics, and logs. * * Implements the protobuf wire format according to: * https://github.com/open-telemetry/opentelemetry-proto * * @internal */ /** * Encodes an AnyValue message. * * message AnyValue { * oneof value { * string string_value = 1; * bool bool_value = 2; * int64 int_value = 3; * double double_value = 4; * ArrayValue array_value = 5; * KeyValueList kvlist_value = 6; * bytes bytes_value = 7; * } * } */ export declare const encodeAnyValue: (value: AnyValue) => Uint8Array; /** * Encodes an ArrayValue message. * * message ArrayValue { * repeated AnyValue values = 1; * } */ export declare const encodeArrayValue: (value: { values: ReadonlyArray; }) => Uint8Array; /** * Encodes a KeyValueList message. * * message KeyValueList { * repeated KeyValue values = 1; * } */ export declare const encodeKeyValueList: (value: { values: ReadonlyArray; }) => Uint8Array; /** * Encodes a KeyValue message. * * message KeyValue { * string key = 1; * AnyValue value = 2; * } */ export declare const encodeKeyValue: (kv: KeyValue) => Uint8Array; /** * Encodes an InstrumentationScope message. * * message InstrumentationScope { * string name = 1; * string version = 2; * repeated KeyValue attributes = 3; * uint32 dropped_attributes_count = 4; * } */ export declare const encodeInstrumentationScope: (scope: { readonly name: string; readonly version?: string; readonly attributes?: ReadonlyArray; readonly droppedAttributesCount?: number; }) => Uint8Array; /** * Encodes a Resource message. * * message Resource { * repeated KeyValue attributes = 1; * uint32 dropped_attributes_count = 2; * } */ export declare const encodeResource: (resource: Resource) => Uint8Array; /** * Status code enum */ export declare const StatusCode: { readonly Unset: 0; readonly Ok: 1; readonly Error: 2; }; /** * SpanKind enum */ export declare const SpanKind: { readonly Unspecified: 0; readonly Internal: 1; readonly Server: 2; readonly Client: 3; readonly Producer: 4; readonly Consumer: 5; }; /** * Encodes a Status message. * * message Status { * string message = 2; * StatusCode code = 3; * } */ export declare const encodeStatus: (status: { readonly code: number; readonly message?: string; }) => Uint8Array; /** * Encodes an Event message. * * message Event { * fixed64 time_unix_nano = 1; * string name = 2; * repeated KeyValue attributes = 3; * uint32 dropped_attributes_count = 4; * } */ export declare const encodeEvent: (event: { readonly timeUnixNano: string; readonly name: string; readonly attributes: ReadonlyArray; readonly droppedAttributesCount: number; }) => Uint8Array; /** * Encodes a Link message. * * message Link { * bytes trace_id = 1; * bytes span_id = 2; * string trace_state = 3; * repeated KeyValue attributes = 4; * uint32 dropped_attributes_count = 5; * fixed32 flags = 6; * } */ export declare const encodeLink: (link: { readonly traceId: string; readonly spanId: string; readonly traceState?: string; readonly attributes: ReadonlyArray; readonly droppedAttributesCount: number; readonly flags?: number; }) => Uint8Array; /** * Encodes a Span message. * * message Span { * bytes trace_id = 1; * bytes span_id = 2; * string trace_state = 3; * bytes parent_span_id = 4; * string name = 5; * SpanKind kind = 6; * fixed64 start_time_unix_nano = 7; * fixed64 end_time_unix_nano = 8; * repeated KeyValue attributes = 9; * uint32 dropped_attributes_count = 10; * repeated Event events = 11; * uint32 dropped_events_count = 12; * repeated Link links = 13; * uint32 dropped_links_count = 14; * Status status = 15; * fixed32 flags = 16; * } */ export declare const encodeSpan: (span: { readonly traceId: string; readonly spanId: string; readonly traceState?: string; readonly parentSpanId?: string; readonly name: string; readonly kind: number; readonly startTimeUnixNano: string; readonly endTimeUnixNano: string; readonly attributes: ReadonlyArray; readonly droppedAttributesCount: number; readonly events: ReadonlyArray<{ readonly timeUnixNano: string; readonly name: string; readonly attributes: ReadonlyArray; readonly droppedAttributesCount: number; }>; readonly droppedEventsCount: number; readonly links: ReadonlyArray<{ readonly traceId: string; readonly spanId: string; readonly traceState?: string; readonly attributes: ReadonlyArray; readonly droppedAttributesCount: number; readonly flags?: number; }>; readonly droppedLinksCount: number; readonly status: { readonly code: number; readonly message?: string; }; readonly flags?: number; }) => Uint8Array; /** * Encodes a ScopeSpans message. * * message ScopeSpans { * InstrumentationScope scope = 1; * repeated Span spans = 2; * string schema_url = 3; * } */ export declare const encodeScopeSpans: (scopeSpans: { readonly scope: { readonly name: string; readonly version?: string; }; readonly spans: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a ResourceSpans message. * * message ResourceSpans { * Resource resource = 1; * repeated ScopeSpans scope_spans = 2; * string schema_url = 3; * } */ export declare const encodeResourceSpans: (resourceSpans: { readonly resource: Resource; readonly scopeSpans: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a TracesData message (top-level export request). * * message TracesData { * repeated ResourceSpans resource_spans = 1; * } */ export declare const encodeTracesData: (tracesData: { readonly resourceSpans: ReadonlyArray[0]>; }) => Uint8Array; /** * AggregationTemporality enum */ export declare const AggregationTemporality: { readonly Unspecified: 0; readonly Delta: 1; readonly Cumulative: 2; }; /** * Encodes a NumberDataPoint message. * * message NumberDataPoint { * repeated KeyValue attributes = 7; * fixed64 start_time_unix_nano = 2; * fixed64 time_unix_nano = 3; * oneof value { * double as_double = 4; * sfixed64 as_int = 6; * } * repeated Exemplar exemplars = 5; * uint32 flags = 8; * } */ export declare const encodeNumberDataPoint: (point: { readonly attributes: ReadonlyArray; readonly startTimeUnixNano: string; readonly timeUnixNano: string; readonly asDouble?: number | undefined; readonly asInt?: string | number | bigint | undefined; readonly flags?: number | undefined; }) => Uint8Array; /** * Encodes a HistogramDataPoint message. * * message HistogramDataPoint { * repeated KeyValue attributes = 9; * fixed64 start_time_unix_nano = 2; * fixed64 time_unix_nano = 3; * fixed64 count = 4; * optional double sum = 5; * repeated fixed64 bucket_counts = 6; * repeated double explicit_bounds = 7; * optional double min = 11; * optional double max = 12; * uint32 flags = 10; * } */ export declare const encodeHistogramDataPoint: (point: { readonly attributes: ReadonlyArray; readonly startTimeUnixNano: string; readonly timeUnixNano: string; readonly count: string | number | bigint; readonly sum?: number | undefined; readonly bucketCounts: ReadonlyArray; readonly explicitBounds: ReadonlyArray; readonly min?: number | undefined; readonly max?: number | undefined; readonly flags?: number | undefined; }) => Uint8Array; /** * Encodes a Gauge message. * * message Gauge { * repeated NumberDataPoint data_points = 1; * } */ export declare const encodeGauge: (gauge: { readonly dataPoints: ReadonlyArray[0]>; }) => Uint8Array; /** * Encodes a Sum message. * * message Sum { * repeated NumberDataPoint data_points = 1; * AggregationTemporality aggregation_temporality = 2; * bool is_monotonic = 3; * } */ export declare const encodeSum: (sum: { readonly dataPoints: ReadonlyArray[0]>; readonly aggregationTemporality: number; readonly isMonotonic: boolean; }) => Uint8Array; /** * Encodes a Histogram message. * * message Histogram { * repeated HistogramDataPoint data_points = 1; * AggregationTemporality aggregation_temporality = 2; * } */ export declare const encodeHistogram: (histogram: { readonly dataPoints: ReadonlyArray[0]>; readonly aggregationTemporality: number; }) => Uint8Array; /** * Encodes a Metric message. * * message Metric { * string name = 1; * string description = 2; * string unit = 3; * oneof data { * Gauge gauge = 5; * Sum sum = 7; * Histogram histogram = 9; * ExponentialHistogram exponential_histogram = 10; * Summary summary = 11; * } * } */ export declare const encodeMetric: (metric: { readonly name: string; readonly description?: string | undefined; readonly unit?: string | undefined; readonly gauge?: Parameters[0] | undefined; readonly sum?: Parameters[0] | undefined; readonly histogram?: Parameters[0] | undefined; }) => Uint8Array; /** * Encodes a ScopeMetrics message. * * message ScopeMetrics { * InstrumentationScope scope = 1; * repeated Metric metrics = 2; * string schema_url = 3; * } */ export declare const encodeScopeMetrics: (scopeMetrics: { readonly scope: { readonly name: string; readonly version?: string; }; readonly metrics: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a ResourceMetrics message. * * message ResourceMetrics { * Resource resource = 1; * repeated ScopeMetrics scope_metrics = 2; * string schema_url = 3; * } */ export declare const encodeResourceMetrics: (resourceMetrics: { readonly resource: Resource; readonly scopeMetrics: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a MetricsData message (top-level export request). * * message MetricsData { * repeated ResourceMetrics resource_metrics = 1; * } */ export declare const encodeMetricsData: (metricsData: { readonly resourceMetrics: ReadonlyArray[0]>; }) => Uint8Array; /** * SeverityNumber enum */ export declare const SeverityNumber: { readonly Unspecified: 0; readonly Trace: 1; readonly Trace2: 2; readonly Trace3: 3; readonly Trace4: 4; readonly Debug: 5; readonly Debug2: 6; readonly Debug3: 7; readonly Debug4: 8; readonly Info: 9; readonly Info2: 10; readonly Info3: 11; readonly Info4: 12; readonly Warn: 13; readonly Warn2: 14; readonly Warn3: 15; readonly Warn4: 16; readonly Error: 17; readonly Error2: 18; readonly Error3: 19; readonly Error4: 20; readonly Fatal: 21; readonly Fatal2: 22; readonly Fatal3: 23; readonly Fatal4: 24; }; /** * Encodes a LogRecord message. * * message LogRecord { * fixed64 time_unix_nano = 1; * fixed64 observed_time_unix_nano = 11; * SeverityNumber severity_number = 2; * string severity_text = 3; * AnyValue body = 5; * repeated KeyValue attributes = 6; * uint32 dropped_attributes_count = 7; * fixed32 flags = 8; * bytes trace_id = 9; * bytes span_id = 10; * } */ export declare const encodeLogRecord: (record: { readonly timeUnixNano: string; readonly observedTimeUnixNano?: string | undefined; readonly severityNumber?: number | undefined; readonly severityText?: string | undefined; readonly body?: AnyValue | undefined; readonly attributes: ReadonlyArray; readonly droppedAttributesCount?: number | undefined; readonly flags?: number | undefined; readonly traceId?: string | undefined; readonly spanId?: string | undefined; }) => Uint8Array; /** * Encodes a ScopeLogs message. * * message ScopeLogs { * InstrumentationScope scope = 1; * repeated LogRecord log_records = 2; * string schema_url = 3; * } */ export declare const encodeScopeLogs: (scopeLogs: { readonly scope: { readonly name: string; readonly version?: string; }; readonly logRecords: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a ResourceLogs message. * * message ResourceLogs { * Resource resource = 1; * repeated ScopeLogs scope_logs = 2; * string schema_url = 3; * } */ export declare const encodeResourceLogs: (resourceLogs: { readonly resource: Resource; readonly scopeLogs: ReadonlyArray[0]>; readonly schemaUrl?: string; }) => Uint8Array; /** * Encodes a LogsData message (top-level export request). * * message LogsData { * repeated ResourceLogs resource_logs = 1; * } */ export declare const encodeLogsData: (logsData: { readonly resourceLogs: ReadonlyArray[0]>; }) => Uint8Array; //# sourceMappingURL=otlpProtobuf.d.ts.map