Grafana with Cribl Stream

API and token settings for reading from Grafana, per the source page.

This post walks through the Grafana source in Cribl Stream, the push endpoint for metric and log data from Grafana Agent instances, and the API and token settings the Grafana source page documents for it.

What the source collects

Cribl Stream supports receiving metric and log data from Grafana Agent instances via the Prometheus remote write specification. The page notes that the Grafana Agent uses Prometheus for metrics collection and Grafana Loki for log collection. The type row lists Type: Push, TLS Support: YES, and Event Breaker Support: No, and the page states the source assumes incoming data is snappy-compressed.

Prometheus remote write requests do not specify metric types, so Cribl Stream determines them at ingest. If the metric name ends with _total, _sum, _count, or _bucket, the type is set to counter; otherwise it is set to gauge. The page notes this is consistent with the type detection used by other services implementing the remote write protocol, and adds that Cribl Stream supports the timer type in addition to counter and gauge.

Cribl Stream uses a set of internal "meta" fields that are not part of an event, but are accessible to Functions. For this source the page lists __inputId, __srcIpPort, __labels, __headers, and __structuredMetadata. The __labels field applies to log events only and contains all the labels found in the event's corresponding Loki stream. __headers is added only when the Capture request headers toggle is on, and __structuredMetadata only when the Enable structured metadata toggle is on.

The __srcIpPort value is the IP address and (optionally) port of the Grafana client sending data. When any proxies, including load balancers, lie between the client and the source, the last proxy adds an X-Forwarded-For header whose value is the original client's IP/port. If that header is present and the Show originating IP toggle is off, the original client IP/port in the header overrides __srcIpPort; with Show originating IP on, the header's contents do not override it.

Setting up the source

Setup starts on the top bar: select Products, then Cribl Stream, and under Worker Groups select a Worker Group. From there the page offers two paths, Routing > QuickConnect or Data > Sources in Stream, and both end in selecting Add Source. The documented flow closes with Save, then Commit & Deploy.

Under General Settings: the Enabled toggle, an Input ID that must be unique (clones get -CLONE appended to the original name), an optional Description, an Address for the hostname/IP to listen to, defaulting to 0.0.0.0, and the Port number to listen on.

Optional Settings cover the endpoints, and at least one is required. The Remote Write API endpoint defaults to /api/prom/push, which in the page's example expands as http://<your-upstream-URL>:<your-port>/api/prom/push. The Logs API endpoint defaults to /loki/api/v1/push, expanding as http://<your-upstream-URL>:<your-port>/loki/api/v1/push. The Enable structured metadata toggle parses and extracts key-value pairs beyond labels from incoming Loki log payloads, supporting high-cardinality fields without polluting the label set, and stores the extracted metadata in __structuredMetadata to be forwarded through the Pipeline. Tags let you filter and group sources in the Cribl Stream UI; they are not added to processed events.

The Authentication tab provides separate Loki and Prometheus sections with identical options. You select one of: None, which uses no authentication; Auth token, where you enter the bearer token that must be included in the authorization header; Auth token (text secret), an HTTP token referenced by a stored secret; Basic, with Username and Password fields; and Basic (credentials secret), username and password credentials referenced by a secret.

Under TLS Settings (Server Side), Enabled defaults to toggled off. Server Certificate takes a predefined certificate name or manual paths: Certificate path and Private key path, both in PEM format and able to reference $ENV_VARS, plus a Passphrase to decrypt the key. Mutual Authentication (mTLS) defaults off via the Authenticate client (mutual auth) toggle, which requires clients to present their certificates; when on, it exposes Trusted client CA path, Validate client certificates (default on), and a Common name regex that a peer certificate's subject attribute must match, defaulting to .* and matching the substring after CN=, with the page's example matching the subject CN=worker.cribl.local via worker\.cribl\.local. If the subject contains SAN entries, the regex is checked against all of them and the CN entry is ignored. Minimum and Maximum TLS version thresholds reject clients outside the range, and selecting TLSv1 or TLSv1.1 as the minimum shows a deprecation warning.

The Persistent Queue Settings tab buffers and preserves incoming events when a downstream Destination has an outage or backpressure. Mode offers Always On, which writes events to the queue before forwarding them, and Smart, which engages only when the source detects backpressure. Buffer size limit (bytes) accepts 64KB to 10MB, defaults to 1MB, and per the page's deprecation notice replaces the events-based setting as of version 4.18.0, with upgraded Worker Groups and Fleets defaulting to 1MB. Queue size limit is required, defaults to 5 GB, and can go as high as 1 TB unless Group or Fleet settings cap it. The remaining documented controls carry their own defaults: Commit frequency 42, File size limit 10 MB, Queue file path $CRIBL_HOME/state/queues, Compression None (with Gzip available), and Queue-full behavior Block or Drop new data. The page scopes the tab: on Cribl-managed Cloud Workers with an Enterprise plan it exposes only the Enable persistent queue toggle. If enabled, PQ is automatically configured in Always On mode with a 1 GB limit of uncompressed inbound data per PQ-enabled Source, per Worker Process, that is not configurable, and all other settings in the section apply to on-prem and hybrid deployments only.

Processing Settings offer Fields, for defining or modifying fields with JavaScript expressions similar to the Eval function, and Pre-Processing, which selects a single existing Pipeline or Pack to run on this input's data before it goes through the Routes.

Advanced Settings document a run of toggles and limits: Show originating IP, which keeps the client's original IP address when clients connect through a proxy that sends X-Forwarded-For; Capture request headers, which stores request headers in __headers; Health check endpoint, which enables http(s)://<host>:<port>/cribl_health, a 200 response when healthy, otherwise ECONNRESET or a 503 with Server is busy, max active connections reached; Active request limit, on-prem only, default 256 with 0 for unlimited; Activity log sample rate, default 100; Requests-per-socket limit, Socket timeout, and Request timeout, all defaulting to 0 (unlimited or wait forever); Keep-alive timeout, default 5 seconds with a 600-second maximum; IP allowlist regex, default .* (allow all), and IP denylist regex, default ^$ (allow all), with rejected requests receiving a 403 (Forbidden) status; and Environment, which in GitOps can pin the configuration to a single Git branch.

Under Connected Destinations, Send to Routes enables conditional routing, filtering, and cloning of the source's data via the Routing table; QuickConnect sends the data to one or more Destinations via independent, direct connections.

What the docs flag

The page deprecates Smart mode for Source persistent queue on hybrid and on-prem deployments: in January 2027, affected configurations will automatically migrate to Always On mode. Before changing anything, it advises monitoring persistent queue usage so you can allocate enough disk space, draining the queues first to avoid orphaned data, and verifying that data routing and filtering behaves as expected in a test environment before rolling out to production.

A warning sits on Capture request headers. When enabled, the source stores inbound headers in __headers, which some Destinations also read for outbound behavior: HTTP Destinations such as Webhook, Loki, Microsoft Sentinel, Dynatrace HTTP, and Cortex XSIAM use it for dynamic request headers, and Kafka Destinations use it for message headers. Events can then leave Cribl Stream with healthy-looking Source, Route, and Destination metrics while data does not arrive or is rejected downstream, or you see TLS certificate or hostname validation failures, or authentication errors such as invalid audience. The fix is an Eval function that removes __headers before the Destination, or copies it to another field name first, since the Rename function cannot operate on fields whose names begin with __. If TLS or certificate errors appear and __headers contains a host value, the page also offers toggling Validate server certs off on the Destination, but that weakens TLS verification, so use it only after you confirm the conflict is the cause.

Two smaller flags sit in the settings sections. When you disable Authenticate client (mutual auth), the Trusted client CA path field is hidden in the UI, but any value already saved remains on disk. And raising Active request limit increases resource usage and load on both your Cribl Stream infrastructure and downstream Destinations; the page warns that improper sizing on either side can result in dropped events, delayed processing, or overall system instability.

The page's Common Issue section covers an invalid token: the specified token is invalid, and the message is logged only at the debug level. The log entry, copied from the Grafana source page:

Dropping request because token invalid","authToken": "Bas...Njc="

Frequently asked questions

What does the Cribl Stream Grafana source collect?

It receives metric and log data from Grafana Agent instances via the Prometheus remote write specification. The Grafana Agent uses Prometheus for metrics collection and Grafana Loki for log collection, and the source assumes incoming data is snappy-compressed.

Which authentication options does the Cribl Stream Grafana source offer?

The Authentication tab offers None, Auth token, Auth token (text secret), Basic, and Basic (credentials secret), in separate Loki and Prometheus sections with identical options. For Auth token, the bearer token you enter must be included in the authorization header.

Where do Loki labels land on events ingested by the Cribl Stream Grafana source?

Log events carry the __labels internal field, which contains all the labels found in the event's corresponding Loki stream. When the Enable structured metadata toggle is on, extracted structured metadata is stored in the __structuredMetadata field.

What happens when a token sent to the Cribl Stream Grafana source is invalid?

The source drops the request, and the page notes the message is logged only at the debug level. The log entry appears in the source page's Common Issue section and states that the specified token is invalid.

Source

Verified against Cribl Stream 4.20 documentation on November 14, 2026.