This is documentation for the next version of Grafana Alloy Documentation. For the latest stable release, go to the latest version.

Experimental Open source

otelcol.receiver.cloudflare

EXPERIMENTAL: This is an experimental component. Experimental components are subject to frequent breaking changes, and may be removed with no equivalent replacement. To enable and use an experimental component, you must set the stability.level flag to experimental.

otelcol.receiver.cloudflare receives logs sent by Cloudflare LogPush jobs.

Note

otelcol.receiver.cloudflare is a wrapper over the upstream OpenTelemetry Collector cloudflare receiver. Bug reports or feature requests will be redirected to the upstream repository, if necessary.

You can specify multiple otelcol.receiver.cloudflare components by giving them different labels.

Usage

Alloy
otelcol.receiver.cloudflare "<LABEL>" {
  endpoint = "0.0.0.0:12345"

  output {
    logs = [...]
  }
}

Arguments

You can use the following arguments with otelcol.receiver.cloudflare:

NameTypeDescriptionDefaultRequired
endpointstringThe <HOST:PORT> endpoint address on which the receiver awaits requests from Cloudflare.yes
secretstringIf this value is set, the receiver expects to see it in any valid requests under the X-CF-Secret header.no
attributesmap[string]stringSets log attributes from message fields. Only string, boolean, integer, or float fields can be mapped.no
delimiterstringThe separator to join nested fields in the log message when setting attributes."."no
timestamp_fieldstringLog field name that contains timestamp."EdgeStartTimestamp"no
timestamp_formatstringOne of unix, unixnano, or rfc3339, matching how your LogPush job encodes the timestamp field."rfc3339"no

When the attributes configuration is empty, the receiver will automatically ingest all fields from the log messages as attributes, using the original field names as attribute names.

Refer to the upstream receiver documentation for more details.

Blocks

You can use the following blocks with otelcol.receiver.cloudflare:

BlockDescriptionRequired
outputConfigures where to send received telemetry data.yes
tlsCustom server TLS configuration.no

output

Required

The output block configures a set of components to forward resulting telemetry data to.

The following arguments are supported:

NameTypeDescriptionDefaultRequired
logslist(otelcol.Consumer)List of consumers to send logs to.[]no
metricslist(otelcol.Consumer)List of consumers to send metrics to.[]no
traceslist(otelcol.Consumer)List of consumers to send traces to.[]no

You must specify the output block, but all its arguments are optional. By default, telemetry data is dropped. Configure the metrics, logs, and traces arguments accordingly to send telemetry data to other components.

tls

The tls block configures TLS settings used for a server. If the tls block isn’t provided, TLS won’t be used for connections to the server.

The following arguments are supported:

NameTypeDescriptionDefaultRequired
ca_filestringPath to the CA file.no
ca_pemstringCA PEM-encoded text to validate the server with.no
cert_filestringPath to the TLS certificate.no
cert_pemstringCertificate PEM-encoded text for client authentication.no
cipher_suiteslist(string)A list of TLS cipher suites that the TLS transport can use.[]no
client_ca_filestringPath to the TLS cert to use by the server to verify a client certificate.no
curve_preferenceslist(string)Set of elliptic curves to use in a handshake.[]no
include_system_ca_certs_poolbooleanWhether to load the system certificate authorities pool alongside the certificate authority.falseno
key_filestringPath to the TLS certificate key.no
key_pemsecretKey PEM-encoded text for client authentication.no
max_versionstringMaximum acceptable TLS version for connections."TLS 1.3"no
min_versionstringMinimum acceptable TLS version for connections."TLS 1.2"no
reload_intervaldurationThe duration after which the certificate is reloaded."0s"no

If reload_interval is set to "0s", the certificate never reloaded.

The following pairs of arguments are mutually exclusive and can’t both be set simultaneously:

  • ca_pem and ca_file
  • cert_pem and cert_file
  • key_pem and key_file

If cipher_suites is left blank, a safe default list is used. Refer to the Go Cipher Suites documentation for a list of supported cipher suites.

client_ca_file sets the ClientCA and ClientAuth to RequireAndVerifyClientCert in the TLSConfig. Refer to the Go TLS documentation for more information.

The curve_preferences argument determines the set of elliptic curves to prefer during a handshake in preference order. If not provided, a default list is used. The set of elliptic curves available are X25519, P521, P256, and P384.

Exported fields

otelcol.receiver.cloudflare doesn’t export any fields.

Component health

otelcol.receiver.cloudflare is only reported as unhealthy if given an invalid configuration.

Debug information

otelcol.receiver.cloudflare doesn’t expose any component-specific debug information.

Example

The following example receives logs from Cloudflare and forwards them through a batch processor:

Alloy
otelcol.receiver.cloudflare "default" {
  endpoint = "0.0.0.0:12345"
  secret = "1234567890abcdef1234567890abcdef"
  timestamp_field = "EdgeStartTimestamp"
  timestamp_format = "rfc3339"
  attributes = {
    ClientIP = "http_request.client_ip",
    ClientRequestURI = "http_request.uri",
  }

  tls {
    cert_file = "/path/to/cert.pem"
    key_file = "/path/to/key.pem"
  }

  output {
    logs = [otelcol.processor.batch.default.input]
  }
}

otelcol.processor.batch "default" {
  output {
    logs = [otelcol.exporter.otlp.default.input]
  }
}

otelcol.exporter.otlp "default" {
  client {
    endpoint = env("<OTLP_ENDPOINT>")
  }
}

Compatible components

otelcol.receiver.cloudflare can accept arguments from the following components:

Note

Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.