Grafana Loki
Send logs to Grafana Loki using the OpenTelemetry Protocol (OTLP) HTTP exporter. Grafana Loki is a high-volume log aggregation system designed to be cost-effective and easy to operate.
Supported Telemetry Types
Traces
✗
Metrics
✗
Logs
✓
Prerequisites
Before configuring the Grafana Loki (OTLP) destination, ensure you have:
A running Grafana Loki instance (local or remote)
Network connectivity from your Bindplane agent to the Loki instance
The OTLP HTTP receiver enabled and configured in your Loki deployment
The appropriate network ports open (default: HTTP
3100)Optional: Basic authentication credentials (if enabled on Loki)
Optional: TLS certificates (if using HTTPS/mTLS)
For help deploying Grafana Loki, see the Grafana Loki deployment documentation and OTLP configuration guide.
Configuration
Basic Configuration
The minimum configuration requires only the Loki endpoint. The endpoint should point to your Loki OTLP HTTP receiver.
Parameters:
Endpoint
String
-
Loki ingestion address (e.g., http://localhost:3100/otlp)
Yes
Advanced Configuration
Authentication
Basic authentication can be enabled for Grafana Loki endpoints that require it.
Use Basic Auth
Boolean
false
Enable basic authentication
No
Username
String
-
Username for basic authentication
Conditional*
Password
String
-
Password for basic authentication
Conditional*
*Required if Use Basic Auth is enabled
General Settings
Settings for controlling log processing and timeout behavior.
Drop Raw Copy
Boolean
true
Drop the raw copy of the log record stored in log.record.original
No
Timeout
Integer
30
Timeout in seconds for sending batches to Loki
Yes
TLS Configuration
TLS encryption is available for secure communication with Grafana Loki.
Enable TLS
Boolean
false
Enable TLS encryption
No
Skip TLS Certificate Verification
Boolean
false
Skip TLS certificate verification
No
TLS Certificate Authority File
String
-
Path to CA certificate file
No
Mutual TLS
Boolean
false
Enable mutual TLS (mTLS)
No
TLS Client Certificate File
String
-
Path to client certificate file
Conditional**
TLS Client Private Key File
String
-
Path to client private key file
Conditional**
**Required if Mutual TLS is enabled
Retry and Queuing
This destination supports the following retry and queuing settings:
Enable Retry on Failure
Boolean
true
Enable retry on failure
Initial Interval
Integer
5
Initial retry interval in seconds
Max Interval
Integer
30
Maximum retry interval in seconds
Max Elapsed Time
Integer
300
Maximum total retry time in seconds
Enable Sending Queue
Boolean
true
Enable sending queue for buffering
Number of Consumers
Integer
10
Number of queue consumers
Queue Size
Integer
5000
Maximum queue size in batches
Enable Persistent Queuing
Boolean
true
Enable persistent disk-based queuing
Persistent Queue Directory
String
${OIQ_OTEL_COLLECTOR_HOME}/storage
Directory for persistent queue storage
Synchronize Persistent Queue to Disk
Boolean
false
Synchronize persistent queue to disk for data integrity
For more information, see Retry and Queuing Configuration.
Examples
Basic Configuration (Local Loki)
This example configures the destination to send logs to a local Grafana Loki instance.
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
id: loki
name: Grafana Loki
spec:
type: loki_otlp
parameters:
- name: endpoint
value: 'http://localhost:3100/otlp'
- name: drop_raw_copy
value: true
- name: retry_on_failure_enabled
value: true
- name: sending_queue_enabled
value: trueConfiguration with Basic Authentication
This example demonstrates a production-ready configuration with basic authentication.
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
id: loki-authenticated
name: Grafana Loki (Authenticated)
spec:
type: loki_otlp
parameters:
- name: endpoint
value: 'https://loki.example.com/otlp'
- name: use_basic_auth
value: true
- name: basic_auth_username
value: 'loki-user'
- name: basic_auth_password
value: 'secure-password'
- name: drop_raw_copy
value: true
- name: retry_on_failure_enabled
value: true
- name: sending_queue_enabled
value: true
- name: persistent_queue_enabled
value: trueSecure Configuration with TLS and Basic Authentication
This example demonstrates a highly secure production configuration with TLS encryption and authentication.
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
id: loki-secure
name: Grafana Loki (Secure)
spec:
type: loki_otlp
parameters:
- name: endpoint
value: 'https://loki.example.com/otlp'
- name: use_basic_auth
value: true
- name: basic_auth_username
value: 'loki-user'
- name: basic_auth_password
value: 'secure-password'
- name: configure_tls
value: true
- name: insecure_skip_verify
value: false
- name: ca_file
value: '/etc/ssl/certs/ca.crt'
- name: drop_raw_copy
value: true
- name: retry_on_failure_enabled
value: true
- name: sending_queue_enabled
value: true
- name: persistent_queue_enabled
value: true
- name: persistent_queue_fsync
value: trueMutual TLS Configuration
This example shows how to configure mutual TLS (mTLS) with client certificates.
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
id: loki-mtls
name: Grafana Loki (mTLS)
spec:
type: loki_otlp
parameters:
- name: endpoint
value: 'https://loki.example.com/otlp'
- name: configure_tls
value: true
- name: insecure_skip_verify
value: false
- name: ca_file
value: '/etc/ssl/certs/ca.crt'
- name: mutual_tls
value: true
- name: cert_file
value: '/etc/ssl/certs/client.crt'
- name: key_file
value: '/etc/ssl/private/client.key'
- name: drop_raw_copy
value: true
- name: retry_on_failure_enabled
value: true
- name: sending_queue_enabled
value: true
- name: persistent_queue_enabled
value: trueConfiguration Tips
Endpoint Configuration
Use the format:
http://hostname:port/otlporhttps://hostname:port/otlpDefault port for Loki OTLP is
3100The
/otlppath is required in the endpoint URLVerify Loki is configured to accept OTLP logs
Test the endpoint:
curl -I http://localhost:3100/otlp
Raw Copy Handling
Enable Drop Raw Copy to reduce storage by removing the
log.record.originalattributeDisable only if you need the original raw log record for debugging
Default behavior (enabled) is recommended for production environments to save storage space
Security Best Practices
Always use HTTPS in production environments
Set Skip TLS Certificate Verification to
falseand provide a CA certificate when possibleUse basic authentication only over HTTPS/TLS connections
Consider mutual TLS for highly sensitive environments or zero-trust networks
Store credentials securely using environment variables or secret management systems
Regularly rotate credentials and certificates
Use Grafana service accounts when available for better access control
Performance Tuning
Increase Queue Size for high-volume log collection (default: 5000)
Adjust Number of Consumers based on available CPU and network bandwidth
Enable Persistent Queuing for mission-critical log collection
Monitor queue depth and adjust settings if queues are consistently full
Enable Synchronize Persistent Queue to Disk in critical environments (with performance trade-off)
Disable Synchronize Persistent Queue to Disk for better performance when acceptable data loss risk is low
Network Considerations
Ensure network connectivity between your Bindplane agent and the Grafana Loki endpoint
Verify the OTLP HTTP receiver is enabled in your Loki configuration
Open firewall rules for the appropriate port (default: 3100)
Check if a proxy is required and configure accordingly
Test connectivity before deployment:
curl -I https://endpoint/otlp
Troubleshooting
Connection Refused
Symptoms: Logs are not being sent; connection timeout errors in logs.
Solutions:
Verify Grafana Loki is running:
docker psor check systemd statusVerify the endpoint URL is correct (should include
/otlppath)Test connectivity:
curl -I http://endpoint:3100/otlpVerify network firewall rules allow traffic on the port
Check Loki logs for errors
TLS Certificate Errors
Symptoms: "certificate verify failed" or "bad certificate" errors in logs.
Solutions:
Verify the CA certificate path exists and is readable
Check certificate validity:
openssl x509 -in <cert> -noout -datesVerify the certificate matches the hostname used in configuration
For self-signed certificates, ensure the CA certificate is installed correctly
Temporarily set Skip TLS Certificate Verification to
truefor testing (not recommended for production)
Authentication Failures
Symptoms: "401 Unauthorized" or authentication errors in logs.
Solutions:
Verify username and password are correct
Check that basic authentication is enabled on the Grafana Loki OTLP receiver
Ensure credentials are being transmitted over HTTPS/TLS
Verify credentials don't contain special characters that need escaping in YAML
Logs Not Appearing in Loki
Symptoms: Logs are sent but don't appear in Loki UI or queries.
Solutions:
Verify logs are being generated by the source
Check that Loki has at least one label configured (Loki requires labels for all logs)
Verify the OTLP receiver is configured correctly in Loki
Check Loki logs for ingestion errors or rejections
Verify log volume isn't exceeding Loki rate limits
High Queue Depth
Symptoms: Sending queue is consistently full; logs may be dropped if persistent queuing is disabled.
Solutions:
Verify Grafana Loki instance can handle the log volume
Check for network latency or bandwidth issues
Increase Queue Size to buffer more logs
Increase Number of Consumers to process batches faster
Enable Persistent Queuing to prevent log loss during outages
Consider distributing logs across multiple Loki instances
Performance Issues
Symptoms: High CPU or memory usage; slow log ingestion.
Solutions:
Monitor Bindplane agent CPU and memory usage
Consider reducing log volume at the source (sampling, filtering)
Disable Synchronize Persistent Queue to Disk if enabled (unless data integrity is critical)
Verify network connectivity and latency to Loki
Consider batching at the source to reduce log frequency
Data Loss
Symptoms: Logs are dropped after restarts or network outages.
Solutions:
Enable Persistent Queuing
Verify persistent queue directory exists and has write permissions
Monitor queue size to ensure it's not overflowing
Enable Retry on Failure to handle transient failures
Check available disk space for persistent queue storage
For critical environments, enable Synchronize Persistent Queue to Disk
Review logs for exporter errors or capacity issues
Related Resources
Last updated
Was this helpful?