Options for creating an OpenTelemetry sink.
loggerProvider: ILoggerProvider
The OpenTelemetry logger provider to use.
messageType:
The way to render the message in the log record. If "string"
,
the message is rendered as a single string with the values are
interpolated into the message. If "array"
, the message is
rendered as an array of strings. "string"
by default.
Or even fully customizable with a BodyFormatter function.
objectRenderer: ObjectRenderer
The way to render the object in the log record. If "json"
,
the object is rendered as a JSON string. If "inspect"
,
the object is rendered using util.inspect
in Node.js/Bun, or
Deno.inspect
in Deno. "inspect"
by default.
diagnostics: boolean
Whether to log diagnostics. Diagnostic logs are logged to
the ["logtape", "meta", "otel"]
category.
Turned off by default.
otlpExporterConfig: OTLPExporterNodeConfigBase
The OpenTelemetry OTLP exporter configuration to use.
Ignored if loggerProvider
is provided.
serviceName: string
The service name to use. If not provided, the service name is
taken from the OTEL_SERVICE_NAME
environment variable.
Ignored if loggerProvider
is provided.