Cloudflare Receiver
contrib
Maintainers: @dehaansa
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Getting Started
To successfully operate this receiver, you must follow these steps in order:- Have a Cloudflare site at the Enterprise plan level.
- At the time the receiver was written, LogPush was available only for Enterprise sites.
- Create a LogPush HTTP destination job following the directions provided by Cloudflare. When the job is created, it will attempt to validate the connection to the receiver.
- If you’ve configured the receiver with a
secretto validate requests, ensure you add the value to thedestination_confparameter of the LogPush job by adding its value as a query parameter under theheader_X-CF-Secretparameter. For example,"destination_conf": "https://example.com?header_X-CF-Secret=abcd1234". - If you want the receiver to parse one of the fields as the log record’s timestamp (
EdgeStartTimestampis the default), you must configure the timestamp format in your LogPush job to match your data:- Cloudflare Logpush default
timestamp_formatisunixnano, which the receiver parses automatically. - Use
×tamps=rfc3339inlogpull_optionsfor RFC3339-formatted strings (with or without fractional seconds). - In
output_options, settimestamp_format: "rfc3339"for RFC3339 strings. - In
output_options, settimestamp_format: "unix"for Unix seconds. - In
output_options, settimestamp_format: "unixnano"for Unix nanoseconds.
- Cloudflare Logpush default
- The receiver expects the uploaded logs to be in
ndjsonformat with no template, prefix, suffix, or delimiter changes based on the options inoutput_options. The only settings supported by this receiver inoutput_optionsare:field_namestimestamp_formatsample_rateCVE-2021-44228
- If you’ve configured the receiver with a
- If the LogPush job creates successfully, the receiver is correctly configured and the LogPush job was able to send it a “test” message. If the job failed to create, the most likely issue is with the SSL configuration. Check both the LogPush API response and the receiver’s logs for more details.
Optional
If the receiver will be handling TLS termination:- Receive a properly CA signed SSL certificate for use on the collector host.
- Configure the receiver using the previously acquired SSL certificate, and then start the collector.
Configuration
tls(Optional - Cloudflare requires TLS, and self-signed will not be sufficient)cert_file- You may need to append your CA certificate to the server’s certificate, if it is not a CA known to the LogPush API.
key_file
endpoint- The endpoint on which the receiver will await requests from Cloudflare
secret- If this value is set, the receiver expects to see it in any valid requests under the
X-CF-Secretheader
- If this value is set, the receiver expects to see it in any valid requests under the
timestamp_field(default:EdgeStartTimestamp)- This receiver was built with the Cloudflare
http_requestsdataset in mind, but should be able to support any Cloudflare dataset. If using another dataset, you will need to set thetimestamp_fieldappropriately in order to have the log record be associated with the correct timestamp.
- This receiver was built with the Cloudflare
timestamp_format(default:unixnano)- One of
unix,unixnano, orrfc3339, matching how your LogPush job encodes the timestamp field.
- One of
attributes- This parameter allows the receiver to be configured to set log record attributes based on fields found in the log message. The fields are not removed from the log message when set in this way. Only string, boolean, integer or float fields can be mapped using this parameter.
- When the
attributesconfiguration is empty, the receiver will automatically ingest all fields from the log messages as attributes, using the original field names as attribute names.
separator(default:.)- The separator used to join nested fields in the log message when setting attributes. For example, if the log message contains a field
"RequestHeaders": { "Content-Type": "application/json" }, and theseparatoris set to., the attribute will be set asRequestHeaders.Content_Type. If the separator is set to_, it will be set asRequestHeaders_Content_Type.
- The separator used to join nested fields in the log message when setting attributes. For example, if the log message contains a field
max_request_body_size: configures the maximum allowed body size in bytes for a single request. Default:20971520(20MiB)
Example:
Example with automatic attribute ingestion:
Configuration
Example Configuration
Last generated: 2026-04-13