# Receive logs, metrics, and traces from OpenTelemetry

Starting with version 4.3.0, AxoSyslog can receive logs, metrics, and traces from [OpenTelemetry](<https://opentelemetry.io/>) clients over the [OpenTelemetry Protocol (OTLP/gRPC)](<https://opentelemetry.io/docs/specs/otlp/>).

## Example: Receiving OpenTelemetry data

The following example receives OpenTelemetry data and forwards it to an OpenTelemetry receiver. Note that by default, AxoSyslog doesn’t parse the fields of the incoming messages into name-value pairs, but are only available for forwarding using the `opentelemetry()` destination. To parse the fields into name-value pairs, use the [`opentelemetry()` parser](../../docs/axosyslog-core/chapter-parsers/opentelemetry/index.md).
```
 
    log otel_forward_mode_alts {
      source {
        opentelemetry(
          port(4317)
          auth(alts())
        );
      };
    
      destination {
        opentelemetry(
          url("my-otel-server:12345")
          auth(alts())
        );
      };
    };
    
```

## auth()

You can set authentication in the `auth()` option of the driver. By default, authentication is disabled (`auth(insecure())`).

The following authentication methods are available in the `auth()` block:

### adc()

[Application Default Credentials (ADC)](<https://cloud.google.com/docs/authentication/application-default-credentials>). This authentication method is only available for destinations.

#### service-account-key()

Available in AxoSyslog version 4.15 and later.

Use the specified service account key for ADC authentication. File path must be the absolute path. For example:
```
 
    auth(adc(service-account-key("absolute-path-to-key-file")))
    
```

### alts()

[Application Layer Transport Security (ALTS)](<https://grpc.io/docs/languages/cpp/alts/>) is a simple to use authentication, only available within Google’s infrastructure. It accepts the `target-service-account()` option, where you can list service accounts to match against when authenticating the server.
```
 
      opentelemetry(
        port(4317)
        auth(alts())
      );
    
```

### insecure()

This is the default method, authentication is disabled (`auth(insecure())`).

### tls()

`tls()` accepts the `key-file()`, `cert-file()`, `ca-file()` and `peer-verify()` (possible values: `required-trusted`, `required-untrusted`, `optional-trusted` and `optional-untrusted`) options.
```
 
    destination d_otlp {
        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")
            )
          )
        );
      };
    
```

> Note:
> 
>   * `tls(peer-verify())` is not available for the `opentelemetry()` and `loki()` destination.
>   * The gRPC-based drivers (`opentelemetry()` and `loki()`) have a different `tls()` block implementation from the `network()` or `http()` drivers. Most features are the same.
> 


## channel-args()

|   
---|---  
Type: | arrow list  
Default: | -  
  
_Description:_ The `channel-args()` option is available in gRPC-based drivers. It accepts name-value pairs and sets channel arguments defined in the [GRPC Core library documentation](<https://grpc.github.io/grpc/core/group__grpc__arg__keys.html>). For example:
```
 
    channel-args(
        "grpc.loadreporting" => 1
        "grpc.minimal_stack" => 0
    )
    
```

## concurrent-requests()

|   
---|---  
Type: | integer  
Default: | 2  
  
_Description:_ Configures the maximal number of in-flight gRPC requests per worker. Setting this value in the range of 10s or 100s is recommended when there are a high number of clients sending simultaneously. Ideally, `workers() * concurrent-requests()` should be greater than or equal to the number of clients, but this can increase the memory usage.

## ip()

|   
---|---  
Type: | string  
Default: | `0.0.0.0`  
  
Available in AxoSyslog 4.23 and later.

_Description:_ The IP address to bind to. By default, AxoSyslog listens on every available interface. Note that this is not the address where messages are accepted from.

## keep-alive()

|   
---|---  
Type: | `yes` or `no`  
Default: | `yes`  
  
Available in AxoSyslog 4.20 and later.

_Description:_ Client connections can be kept alive during reload, avoiding unnecessary retry backoffs and other error messages on the client side.

## keep-hostname()

The `opentelemetry()` source ignores this option and uses the address of the OTLP peer as the HOST.

## log-fetch-limit()

|   
---|---  
Type: | number  
Default: | 100  
  
_Description:_ The maximum number of messages fetched from a source during a single poll loop. The destination queues might fill up before flow-control could stop reading if `log-fetch-limit()` is too high.

## log-iw-size()

|   
---|---  
Type: | number  
Default: | 10000  
  
_Description:_ The size of the initial window, this value is used during flow control. Make sure that `log-iw-size()` is larger than the value of `log-fetch-limit()`.

Warning

If you change the value of `log-iw-size()` and `keep-alive()` is enabled, the change will affect only new connections, the `log-iw-size()` of kept-alive connections will not change. To apply the new `log-iw-size()` value to every connection, [restart the `syslog-ng` service](../../docs/axosyslog-core/quickstart/managing-and-checking-linux/index.md#restart-axosyslog). A simple configuration reload is _NOT_ sufficient.

If the source is receiving data using the UDP protocol, always [restart the `syslog-ng` service](../../docs/axosyslog-core/quickstart/managing-and-checking-linux/index.md#restart-axosyslog) after changing the value of `log-iw-size()` for the changes to take effect.

## `port()`

The port number to receive incoming connections. Default value: 4317

## workers()

|   
---|---  
Type: | integer  
Default: | 1  
  
_Description:_ Specifies the number of worker threads (at least 1) that AxoSyslog uses to process the messages of the source. Increasing the number of worker threads can drastically improve the performance of the source.

Last modified March 16, 2026: [Include grpc auth chunk using readfile (fc27d92)](<https://github.com/axoflow/axosyslog-core-docs/commit/fc27d926a5fe0cf209bd0d6eec72828590b92941>)