Skip to main content
Version: 3.2

Prometheus

Cribl LogStream can send metric events to targets and third-party platforms that support Prometheus' remote write specification (overview here). This is a streaming Destination type.

Configuring Cribl LogStream to Output to Prometheus

In the QuickConnect UI: Click + Add beside Destinations. From the resulting drawer's tiles, select Prometheus. Next, click either + Add New or (if displayed) Select Existing. The resulting drawer will provide the following options and fields.

Or, in the Data Routes UI: From the top nav of a LogStream instance or Group, select Data > Destinations. From the resulting page's tiles or the Destinations left nav, select Prometheus. Next, click + Add New to open a New Destination modal that provides the following options and fields.

General Settings

Output ID: Enter a unique name to identify this Prometheus output definition.

Remote Write URL: The endpoint to send events to, e.g.: http://localhost:9200/write

Backpressure behavior: Whether to block, drop, or queue events when all receivers are exerting backpressure.

Persistent Queue Settings

This section is displayed when the Backpressure behavior is set to Persistent Queue.

Max file size: The maximum size to store in each queue file before closing it. Enter a numeral with units of KB, MB, etc. Defaults to 1 MB.

Max queue size: The maximum amount of disk space the queue is allowed to consume. Once this limit is reached, queueing is stopped and data blocking is applied. Enter a numeral with units of KB, MB, etc.

Queue file path: The location for the persistent queue files. This will be of the form: your/path/here/<worker-id>/<output-id>. Defaults to: $CRIBL_HOME/state/queues.

Compression: Codec to use to compress the persisted data, once a file is closed. Defaults to None; Gzip is also available.

Queue-full behavior: Whether to block or drop events when the queue is exerting backpressure (because disk is low or at full capacity). Block is the same behavior as non-PQ blocking, corresponding to the Block option on the Backpressure behavior drop-down. Drop new data throws away incoming data, while leaving the contents of the PQ unchanged.

Authentication

Use the Authentication type buttons to select one of these options:

  • None: Don't use authentication.

  • Auth token: Use HTTP token authentication. In the resulting Token field, enter the bearer token that must be included in the HTTP authorization header.

  • Auth token (text secret): This option exposes a Token (text secret) drop-down, in which you can select a stored text secret that references the bearer token described above. A Create link is available to store a new, reusable secret.

  • Basic: Displays Username and Password fields for you to enter HTTP Basic authentication credentials.

  • Basic (credentials secret): This option exposes a Credentials secret drop-down, in which you can select a stored text secret that references the Basic authentication credentials described above. A Create link is available to store a new, reusable secret.

Processing Settings

Post‑Processing

Pipeline: Pipeline to process data before sending the data out using this output.

System fields: A list of fields to automatically add to events that use this output. By default, includes cribl_host (LogStream Node that processed the event) and cribl_wp (LogStream Worker Process that processed the event). Supports wildcards. Other options include:

  • cribl_pipe – LogStream Pipeline that processed the event.
  • cribl_input – LogStream Source that processed the event.
  • cribl_output – LogStream Destination that processed the event.

Advanced Settings

Validate server certs: Toggle to Yes to reject certificates that are not authorized by a CA in the CA certificate path, nor by another trusted CA (e.g., the system's CA).

Round-robin DNS: Toggle to Yes to use round-robin DNS lookup. When a DNS server returns multiple addresses, this will cause LogStream to cycle through them in the order returned.

Request timeout: Amount of time (in seconds) to wait for a request to complete before aborting it. Defaults to 30.

Request concurrency: Maximum number of concurrent requests before blocking. This is set per Worker Process. Defaults to 5.

Max body size (KB): Maximum size of the request body. Defaults to 4096 KB.

Max events per request: Maximum number of events to include in the request body. The 0 default allows unlimited events.

Flush period (sec): Maximum time between requests. Low values could cause the payload size to be smaller than its configured maximum. Defaults to 1.

Extra HTTP headers: Name/Value pairs to pass as additional HTTP headers.

Metric renaming expression: A JavaScript expression that can be used to rename metrics. The default expression – name.replace(/\\./g, \'_\') – replaces all . characters in a metric's name with the Prometheus-supported _ character. Use the name global variable to access the metric's name. You can access event fields' values via __e.<fieldName>.

Send metadata: Whether to generate and send metrics' metadata (type and metricFamilyName) along with the metrics. The default Yes value displays this additional field:

  • Metadata flush period (sec): How frequently metrics metadata is sent out. Value must at least equal the base Flush period (sec). (In other words, metadata cannot be flushed on a shorter interval.) Defaults to 60 seconds.

Environment: If you're using GitOps, optionally use this field to specify a single Git branch on which to enable this configuration. If empty, the config will be enabled everywhere.

Internal Fields

Cribl LogStream uses a set of internal fields to assist in forwarding data to a Destination.

If an event contains the internal field __criblMetrics, LogStream will send it to the HTTP endpoint as a metric event. Otherwise, LogStream will drop the event.

Notes on HTTP-based Outputs

  • Unlike other HTTP-based Destinations, Prometheus does not display an Advanced Settings > Compress option. The Prometheus remote_write spec assumes that payloads are snappy-compressed by default.

  • LogStream will attempt to use keepalives to reuse a connection for multiple requests. After 2 minutes of the first use, the connection will be thrown away, and a new one will be reattempted. This is to prevent sticking to a particular destination when there is a constant flow of events.

  • If the server does not support keepalives (or if the server closes a pooled connection while idle), a new connection will be established for the next request.

  • When resolving the Destination's hostname, LogStream will pick the first IP in the list for use in the next connection. Enable Round-robin DNS to better balance distribution of events between Prometheus cluster nodes.