Collector Exporter node base config

interface OTLPExporterNodeConfigBase {
    compression?: CompressionAlgorithm;
    concurrencyLimit?: number;
    headers?: Record<string, string> | HeadersFactory;
    httpAgentOptions?: HttpAgentFactory | AgentOptions | AgentOptions;
    keepAlive?: boolean;
    timeoutMillis?: number;
    url?: string;
    userAgent?: string;
}

Hierarchy (View Summary)

Properties

compression?: CompressionAlgorithm
concurrencyLimit?: number
headers?: Record<string, string> | HeadersFactory

Custom headers that will be attached to the HTTP request that's sent to the endpoint.

Prefer using a plain object over a factory function wherever possible. If using a factory function (HttpAgentFactory), do not import http or https at the top of the file Instead, use dynamic import() or require() to load the module. This ensures that the http or https module is not loaded before @opentelemetry/instrumentation-http can instrument it.

Functions passed to the exporter MUST NOT throw errors.

headers: {
Authorization: "Api-Token my-secret-token",
}
headers: async () => {
// ... do whatever you need to obtain the headers, ensuring you `await import('your-library')` to avoid breaking instrumentations ...
return {
Authorization: `Bearer ${token}`,
};
};
httpAgentOptions?: HttpAgentFactory | AgentOptions | AgentOptions

Custom HTTP agent options or a factory function for creating agents.

Prefer using http.AgentOptions or https.AgentOptions over a factory function wherever possible. If using a factory function (HttpAgentFactory), do not import http.Agent or https.Agent statically at the top of the file. Instead, use dynamic import() or require() to load the module. This ensures that the http or https module is not loaded before @opentelemetry/instrumentation-http can instrument it.

httpAgentOptions: {
keepAlive: true,
maxSockets: 10
}
httpAgentOptions: async (protocol) => {
const module = protocol === 'http:' ? await import('http') : await import('https');
return new module.Agent({ keepAlive: true });
}
keepAlive?: boolean
timeoutMillis?: number

Maximum time the OTLP exporter will wait for each batch export. The default value is 10000ms.

url?: string
userAgent?: string

User agent header string to be prepended to the exporter's default value. Availablie since v1.49.0 of the spec. Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#user-agent