This section describes the options of the opentelemetry() destination in syslog-ng OSE.

The following options are available for the opentelemetry() destination.

auth()

The auth() option can be used to set the authentication of the driver. The default state of this option is insecure, as it is not defined.

The following sub-options are available for auth().

adc()

This option is an authentication method that is only available for destinations. For more information, see Application Default Credentials.

alts()

This option is an accessible authentication available for Google infrastructures. Service accounts can be listed with the nested target-service-account() option, to match these against the server.

Example: configure an opentelemetry() destination using auth(alts())

destination {
  opentelemetry(
    url("otel-server:1234")
    auth(alts())
  );
};

insecure()

This option can be used to disable authentication: auth(insecure()).

tls()

The tls() option accepts the following nested sub-options.

destination {
    opentelemetry(
      url("your-otel-server:12346")
      auth(
        tls(
          ca-file("/path/to/ca.pem")
          key-file("/path/to/key.pem")
          cert-file("/path/to/cert.pem")
          peer-verify(yes)
        )
      )
    );
  };

batch-bytes()

Type: number
Default: 0

Description: Sets the maximum size of payload in a batch. If the size of the messages reaches this value, syslog-ng OSE sends the batch to the destination even if the number of messages is less than the value of the batch-lines() option.

Note on batch-timeout() interaction: When actively processing messages from the queue, syslog-ng OSE flushes the batch immediately when either batch-bytes() or batch-lines() limits are reached, regardless of the batch-timeout() setting. However, when the message queue becomes empty and there are batched messages waiting, syslog-ng OSE will only flush them after batch-timeout() expires. This means batch-timeout() acts as a maximum delay for flushing incomplete batches when no new messages arrive.

If the batch-bytes() option is set to 0, the batch size is not limited by the total byte size of the messages, and only the batch-lines() option determines when to send the batch.

If both batch-bytes() and batch-lines() options are set, the batch is sent when either of the limits is reached. For example, if batch-bytes() is set to 1000 and batch-lines() is set to 10, the batch will be sent when either 10 messages are collected or the total size of the messages reaches 1000 bytes, whichever comes first.

If both batch-bytes() and batch-lines() options are set to 0, no batching will occur, and messages will be sent to the destination immediately as they are processed.

Available in syslog-ng OSE version 3.19 and later.

batch-lines()

Type: number
Default: 1

Description: Specifies how many lines are flushed to a destination in one batch. The syslog-ng OSE application waits for this number of lines to accumulate and sends them off in a single batch. Increasing this number increases throughput as more messages are sent in a single batch, but also increases message latency.

For example, if you set batch-lines() to 100, syslog-ng OSE waits for 100 messages.

When batches are flushed:

  • During active message processing: When the queue contains messages, syslog-ng OSE flushes the batch immediately upon reaching the batch-lines() limit, regardless of the batch-timeout() setting.
  • When queue becomes empty: If the batch-timeout() option is enabled and the queue becomes empty with unflushed messages, syslog-ng OSE will only flush them after batch-timeout() expires. If batch-timeout() is disabled, messages are flushed immediately when the queue becomes empty.
  • On shutdown or reload: If you stop or reload syslog-ng OSE, or in case of network sources when the connection with the client is closed, syslog-ng OSE automatically sends any unsent messages to the destination.

Note on batch-timeout() interaction: When actively processing messages from the queue, syslog-ng OSE flushes the batch immediately when the batch-lines() limit is reached, regardless of the batch-timeout() setting. However, when the message queue becomes empty and there are batched messages waiting, syslog-ng OSE will only flush them after batch-timeout() expires. This means batch-timeout() acts as a maximum delay for flushing incomplete batches when no new messages arrive.

For optimal performance, make sure that the syslog-ng OSE source that feeds messages to this destination is configured properly: the value of the log-iw-size() option of the source must be higher than the batch-lines() * workers() of the destination. Otherwise, the size of the batches cannot reach the batch-lines() limit.

batch-timeout()

Type: time in milliseconds
Default: -1 (disabled)

Description: Specifies the time syslog-ng OSE waits for lines to accumulate in the output buffer. The syslog-ng OSE application sends batches to the destinations evenly. The timer starts when the first message arrives to the buffer, so if only few messages arrive, syslog-ng OSE sends messages to the destination at most once every batch-timeout() milliseconds.

channel-args()

Type:
Default:

Description: The channel-args() option is available in gRPC-based drivers. The option accepts name-value pairs and sets channel arguments defined in the GRPC Core library documentation.

Example: channel-args() declaration

    channel-args(
        "grpc.loadreporting" => 1
        "grpc.minimal_stack" => 0
    )

compression()

Type: boolean
Default: no

Available in syslog-ng OSE 4.5 and later versions.

Description: This option enables compression in gRPC requests. Currently, only the deflate compression method is supported.

headers()

Type: arrow list
Default: empty

Available in syslog-ng OSE 4.8 and later versions.

Description: Adds custom gRPC headers to each RPC call. Currently only static header names and values are supported.

headers(
    "organization" => "org-name"
    "stream-name" => "org-stream"
  )

Copyright © 2024 Axoflow

worker-partition-key()

Type: template
Default:  

Description: This option specifies a template. Messages that expand the template to the same value are mapped to the same partition. If batching is enabled and multiple workers are configured, only add messages to a batch that generate identical URLs. To achieve this, set the worker-partition-key() option with a template that contains all the templates used in the url() option, otherwise messages get mixed.

Example: partitioning messages based on destination host

worker-partition-key("${HOST}")

workers()

Type: integer
Default: 1

Description: Specifies the number of worker threads (at least 1) that syslog-ng OSE uses to send messages to the server. Increasing the number of worker threads can drastically improve the performance of the destination.

CAUTION: Hazard of data loss! When you use more than one worker threads together with disk-based buffering, syslog-ng OSE creates a separate disk buffer for each worker thread. This means that decreasing the number of workers can result in losing data currently stored in the disk buffer files. Do not decrease the number of workers when the disk buffer files are in use.

If you are using load-balancing (that is, you have configured multiple servers in the url() option), increase the number of worker threads at least to the number of servers. For example, if you have set three URLs (url(“site1”, “site2”, “site3”)), set the workers() option to 3 or more.

Updated: