Open bvn13 opened 1 year ago
Hi @bvn13
Can you post your complete promtail config.yaml?
I suspect you parse the JSON log in Promtail and create a label for each key, causing a problem with message
, because the label value is too large.
Unfortunately, the Promtail log line looks truncated and does not contain the full error from the server (again, because of the long message
label).
Loki config
auth_enabled: false
server:
http_listen_port: 3100
common:
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://localhost:9093
limits_config:
ingestion_rate_mb: 10
ingestion_burst_size_mb: 15
per_stream_rate_limit: 5MB
# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
#
# Statistics help us better understand how Loki is used, and they show us performance
# levels for most users. This helps us prioritize features and documentation.
# For more information on what's sent, look at
# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go
# Refer to the buildReport method to see what goes into a report.
#
# If you would like to disable reporting, uncomment the following lines:
#analytics:
# reporting_enabled: false
Proimtail config
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /var/log/yh/positions.yaml
clients:
- url: http://10.0.0.7:3100/loki/api/v1/push
scrape_configs:
- job_name: yh-gateway
static_configs:
- targets:
- localhost
labels:
job: yh-gateway-monitoring
__path__: /var/log/yh/yh-backend-gateway.log
pipeline_stages:
- json:
expressions:
level: level
level_value: level_value
logger_name: logger_name
message: message
- labels:
level:
level_name:
logger_name:
message:
- job_name: yh-auth
static_configs:
- targets:
- localhost
labels:
job: yh-auth-monitoring
__path__: /var/log/yh/yh-backend-auth.log
pipeline_stages:
- json:
expressions:
level: level
level_value: level_value
logger_name: logger_name
message: message
- labels:
level:
level_name:
logger_name:
message:
- job_name: yh-gpx-storage
static_configs:
- targets:
- localhost
labels:
job: yh-gpx-storage-monitoring
__path__: /var/log/yh/yh-backend-gpx-storage.log
pipeline_stages:
- json:
expressions:
level: level
level_value: level_value
logger_name: logger_name
message: message
- labels:
level:
level_name:
logger_name:
message:
Promtail 2.1.0 in docker Loki 2.8.0 in docker
My app writes a log entry
It is a valid JSON formed with Logstash from Spring application.
Promtail successfully eats it and tries to send to Loki. But faced 400 BAD REQUEST. Promtail's log contains only
Loki's logs are silent about this entry.
What is going on?