Skip to content

loki-canary sets misleading default streamvalue when push=true #18597

@prnv30

Description

@prnv30

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:

  1. Start loki-canary with -push=true and without specifying -streamvalue
  2. Observe that the stream label is set to "stdout" despite logs being pushed via HTTP
  3. 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 of streamvalue 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions