UNPKG

enhanced-adot-node-autoinstrumentation

Version:

This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.

37 lines 1.83 kB
import { BatchLogRecordProcessor } from '@opentelemetry/sdk-logs'; import type { BufferConfig } from '@opentelemetry/sdk-logs'; import { OTLPAwsLogExporter } from './otlp-aws-log-exporter'; export declare const BASE_LOG_BUFFER_BYTE_SIZE: number; export declare const MAX_LOG_REQUEST_BYTE_SIZE: number; export declare class AwsBatchLogRecordProcessor extends BatchLogRecordProcessor { constructor(exporter: OTLPAwsLogExporter, config?: BufferConfig); /** * Custom implementation of BatchLogRecordProcessor that manages log record batching * with size-based constraints to prevent exceeding AWS request size limits. * * This processor still exports all logs up to maxExportBatchSize but rather than doing exactly * one export promise, we do an array of export Promises where each exported batch will have an additonal constraint: * * If the batch to be exported will have a data size of > 1 MB: * The batch will be split into multiple exports of sub-batches of data size <= 1 MB. * * A unique case is if the sub-batch is of data size > 1 MB, then the sub-batch will have exactly 1 log in it. * */ private _flushOneBatchIntermediary; /** * Calculates the estimated byte size of a log record. * * @param log - The LogRecord to calculate the size for * @returns The estimated size in bytes, including a base buffer size plus the size of the log body */ private static getSizeOfLog; /** * Calculates the size of an AnyValue type. If AnyValue is an instance of a Map or Array, calculation is truncated to one layer. * * @param val - The AnyValue to calculate the size for * @returns The size in bytes */ private static getSizeOfAnyValue; } //# sourceMappingURL=aws-batch-log-record-processor.d.ts.map