Skip to content

OTLP/gRPC Logs Output

Writes TenXObject instances and templates to an OpenTelemetry Collector (or any OTLP-compatible receiver) over OTLP/gRPC. Each rendered event is parsed back into a JSON envelope and emitted as an OTLP LogRecord: the configured body field is lifted into LogRecord.body, every other top-level field becomes a log-record attribute.

For an example configuration, see the OpenTelemetry Collector forwarder output.

Config Files

To configure the OTLP/gRPC logs output module, Edit these files.

Below is the default configuration from: otlp/config.yaml.

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' OTLP/gRPC output configuration

# Configure OTLP/gRPC outputs to write TenXObject instance and template field values
# to an OpenTelemetry Collector (or any OTLP-compatible logs receiver).
# To learn more see https://doc.log10x.com/run/output/event/otlp

# Set the 10x pipeline to 'run'
tenx: run

# =============================== Dependencies ================================

include:
  - run/modules/output/event/otlp

# ============================== Output Options ===============================

# Multiple OTLP/gRPC outputs can be defined below
outputOtlp:

    # 'host' specifies the host address of target OTLP/gRPC logs endpoint
  - host: $=TenXEnv.get("TENX_REMOTE_OTLP_HOST", "127.0.0.1")

    # 'port' specifies the host port of target OTLP/gRPC logs endpoint
    port: $=parseInt(TenXEnv.get("TENX_REMOTE_OTLP_PORT", 4317))

    # 'insecure' sets whether to connect over plaintext (no TLS).
    # To learn more see https://doc.log10x.com/run/output/event/otlp/#outputotlpinsecure
    insecure: "true"

    # 'filter' sets a JavaScript expression that TenXObjects must evaluate as truthy to write to the output.
    # To learn more see https://doc.log10x.com/run/output/receive/#filter-expressions
    filter: null

    # 'fields' defines the fields to write for each TenXObject sent to this output.
    # To learn more see https://doc.log10x.com/run/output/stream/#outputfields
    fields:
      - fullText # https://doc.log10x.com/api/js/#fulltext-string

    # 'encodeType' specifies how 'fields' are encoded to output. Possible values: [json, delimited].
    # To learn more see https://doc.log10x.com/run/output/event/otlp/#outputotlpencodetype
    encodeType: delimited

    # 'writeTemplates' controls whether to write new templates for TenXObjects written to this output.
    writeTemplates: "true"

Options

Specify the options below to configure multiple OTLP/gRPC logs output:

Name Description Category
outputOtlpHost Host address of the target OTLP/gRPC logs endpoint Host
outputOtlpPort TCP port of the target OTLP/gRPC logs endpoint Host
outputOtlpInsecure If true, connect over plaintext (no TLS) Host
outputOtlpBodyField Top-level field name to lift into the OTLP LogRecord body Encoding
outputOtlpTagField Top-level field name to drop from output (synthetic envelope tag) Encoding
outputOtlpBatchSize Maximum number of LogRecords to buffer before flushing Encoding
outputOtlpFlushIntervalMs Maximum age in ms of a buffered LogRecord before forced flush Encoding
outputOtlpFields List of TenXObject field names to encode Encoding
outputOtlpWriteObjects If true, emit TenXObject field values to this output Encoding
outputOtlpWriteTemplates If true, emit new TenXTemplates to this output Encoding
outputOtlpFilter A JavaScript expression that an TenXObject must evaluate as 'truthy' against to be written to this output Encoding
outputOtlpEncodeType The output format in which to encode TenXObject values. Possible values [json, delimited] Encoding
outputOtlpEncodeDelimiter The delimiter placed between key and values pairs if 'outputOtlpEncodeType' is 'delimited' Encoding

Host

outputOtlpHost

Host address of the target OTLP/gRPC logs endpoint.

Type Default Category
String 127.0.0.1 Host

Hostname or IP of the OpenTelemetry Collector (or other OTLP-compatible endpoint) accepting logs via OTLP/gRPC.

outputOtlpPort

TCP port of the target OTLP/gRPC logs endpoint.

Type Default Category
String 4317 Host

TCP port of the OTLP/gRPC logs receiver. Matches the endpoint of the Collector's otlp receiver.

outputOtlpInsecure

If true, connect over plaintext (no TLS).

Type Default Category
String true Host

When true, the gRPC channel is opened in plaintext mode (no TLS). Set to false only when the destination requires TLS.

Encoding

outputOtlpBodyField

Top-level field name to lift into the OTLP LogRecord body.

Type Default Category
String body Encoding

Name of the JSON field on each rendered event to set as the OTLP LogRecord.body. Other top-level fields are emitted as log-record attributes. Set to a non-existent field name to send all data as attributes (no body).

outputOtlpTagField

Top-level field name to drop from output (synthetic envelope tag).

Type Default Category
String tag Encoding

Name of the synthetic envelope tag field carried on the event. The appender drops this field on output so it does not surface as a log-record attribute on the destination side.

outputOtlpBatchSize

Maximum number of LogRecords to buffer before flushing.

Type Default Category
String 100 Encoding

When the buffered LogRecord count reaches this value, the appender immediately flushes via gRPC.

outputOtlpFlushIntervalMs

Maximum age in ms of a buffered LogRecord before forced flush.

Type Default Category
String 1000 Encoding

Periodic flush interval in milliseconds. Buffered LogRecords are flushed at most this often even when the batch size has not been reached. A longer interval lets more records coalesce into a single OTLP ExportLogsServiceRequest, which preserves the resource/scope grouping the destination Collector would see if Log10x weren't in the path.

outputOtlpFields

List of TenXObject field names to encode.

Type Default Category
List [] Encoding

Names of TenXObject intrinsic/extracted/calculated fields to write on each event. With outputOtlpEncodeType: delimited and a single field carrying a JSON envelope (e.g. fullText), the appender re-parses the envelope to recover the original key/value structure.

outputOtlpWriteObjects

If true, emit TenXObject field values to this output.

Type Default Category
String true Encoding

Controls whether instance field values for TenXObjects passed to this output are written. Disable to keep templates-only emission active without ferrying every event payload over OTLP/gRPC.

outputOtlpWriteTemplates

If true, emit new TenXTemplates to this output.

Type Default Category
String false Encoding

Controls whether template values for TenXObjects passed to this output are written. Each new template is emitted at most once. Enable this alongside receiverOptimize true so the destination Collector can decode the compact body using the matching template.

outputOtlpFilter

A JavaScript expression that an TenXObject must evaluate as 'truthy' against to be written to this output.

Type Default Category
String "" Encoding

Specifies a JavaScript expression that a TenXObject must evaluate as truthy to be written to this output. For example, outputOtlpFilter: this.timestamp will only emit TenXObjects whose intrinsic timestamp field is set.

outputOtlpEncodeType

The output format in which to encode TenXObject values. Possible values [json, delimited].

Type Default Category
String delimited Encoding

Wire encoding used by the engine to render fields into the bytes the appender receives. The appender always parses the rendered text as JSON; with delimited and a single JSON-shaped field (fullText), the envelope is recovered intact.

outputOtlpEncodeDelimiter

The delimiter placed between key and values pairs if 'outputOtlpEncodeType' is 'delimited'.

Type Default Category
String , Encoding

Delimiter used to separate TenXObject field values when outputOtlpEncodeType is delimited. Ignored when outputOtlpEncodeType is json (which emits a JSON object instead of delimited values).


This module is defined in otlp/module.yaml.