-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Describe the bug
In loki-canary
, the -streamvalue
flag defaults to "stdout"
even when the -push
flag is set to true
. This is misleading because when push=true
, logs are not written to stdout but are instead pushed directly to the Loki HTTP endpoint. As a result, the stream label shown in queries can be confusing, showing "stdout"
even though stdout is not used.
To Reproduce
Steps to reproduce the behavior:
- Start loki-canary with
-push=true
and without specifying-streamvalue
- Observe that the stream label is set to
"stdout"
despite logs being pushed via HTTP - Query logs in Loki using
{stream="stdout"}
and note the inconsistency in labeling
Expected behavior
If the -streamvalue
flag is not explicitly provided:
- When
-push=true
, the default value ofstreamvalue
should be"push"
to reflect that logs are being sent via HTTP - When
-push=false
, the default can remain"stdout"
This would make the labeling more accurate and intuitive when querying logs.
Environment:
- Infrastructure: Kubernetes
- Deployment tool: Helm
Screenshots, Promtail config, or terminal output
N/A — this is a behavioral issue visible in log labels and flag defaults
Additional context
I plan to submit a PR to address this issue shortly.