Interface CarbonClientOptions

[[CarbonClient]] options.

interface CarbonClientOptions {
    address: string;
    autoConnect?: boolean;
    family?: 4 | 6;
    port?: number;
    prefix?: string;
    retryOnError?: number;
    retryTimeout?: number;
    sendBufferSize?: number;
    sendInterval?: number;
    tlsCA?:
        | null
        | string
        | string[]
        | Buffer<ArrayBufferLike>
        | Buffer<ArrayBufferLike>[];
    tlsCert?:
        | null
        | string
        | string[]
        | Buffer<ArrayBufferLike>
        | Buffer<ArrayBufferLike>[];
    tlsKey?:
        | null
        | string
        | string[]
        | Buffer<ArrayBufferLike>
        | Buffer<ArrayBufferLike>[];
    transport?: Transport;
    udpSendBufferSize?: number;
}

Properties

address: string

For TCP and UDP the hostname or IP address of the server, for IPC the file name of the Unix domain socket.

autoConnect?: boolean

Automatically connect on write if not connected. Defaults to false.

[[CarbonClient.autoConnect]]

family?: 4 | 6

For TCP and UDP the IP address family to use.

[[CarbonClient.family]]

port?: number

Server port to connect to. Defaults to [[DEFAULT_PORT]].

prefix?: string

Prefix added to all metric paths.

retryOnError?: number

Number of automatic retries on network error. Defaults to 0.

[[CarbonClient.retryOnError]]

retryTimeout?: number

Time to wait before retrying after error. Defaults to [[DEFAULT_RETRY_TIMEOUT]].

[[CarbonClient.retryTimeout]]

sendBufferSize?: number

Size of send buffer. If set to 0 metrics are sent immediately. Defaults to [[DEFAULT_SEND_BUFFER_SIZE]].

sendInterval?: number

Buffer wait time. If set to 0 metrics are sent immediately. Defaults to [[DEFAULT_SEND_INTERVAL]].

tlsCA?:
    | null
    | string
    | string[]
    | Buffer<ArrayBufferLike>
    | Buffer<ArrayBufferLike>[]

Override the trusted CA certificates.

tlsCert?:
    | null
    | string
    | string[]
    | Buffer<ArrayBufferLike>
    | Buffer<ArrayBufferLike>[]

PEM encoded TLS certificate if [[CarbonClientOptions.transport]] is 'TLS'.

tlsKey?:
    | null
    | string
    | string[]
    | Buffer<ArrayBufferLike>
    | Buffer<ArrayBufferLike>[]

PEM encoded TLS private key if [[CarbonClientOptions.transport]] is 'TLS'.

transport?: Transport

Transport layer protocol to use. Defaults to [[DEFAULT_TRANSPORT]].

udpSendBufferSize?: number

If [[CarbonClient.transport]] is "UDP" the dgram.SocketOptions.sendBufferSize of UDP sockets.