I use promtail to push my docker-compose’s log,but I meet a problem like this:
level=error ts=2023-05-11T01:38:37.421215001Z caller=client.go:430 component=client host=loki:3100 msg="final error sending batch" status=400 tenant= error="server returned HTTP status 400 Bad Request (400): error at least one label pair is required per stream"
It seems like my promtail configured Incorrectly.This is my config:
I’m having a similar problem myself though I am getting the logs for promtail it is also sending logs like this
2023-11-02 20:42:09.555 trajano_promtail.ic4p6gb3jq91xmqv7cpyep8ij.qsmyx1it80x5lnnjmymouxdb4 stderr
level=error ts=2023-11-03T00:42:09.473271419Z caller=client.go:430 component=client host=loki:3100 msg=“final error sending batch” status=400 tenant= error=“server returned HTTP status 400 Bad Request (400): error at least one label pair is required per stream”
So I am getting the replacement but some messages are causing a problem. So I tried to do the drop when __meta_docker_container_name is '' along with a label check
Turning on debug log didn’t help much since it didn’t tell me what message or log entry it sent that causes the issue.