Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promtail not working in dry-run mode #1900

Closed
aronneagu opened this issue Apr 6, 2020 · 4 comments
Closed

Promtail not working in dry-run mode #1900

aronneagu opened this issue Apr 6, 2020 · 4 comments

Comments

@aronneagu
Copy link

Describe the bug
Running promtail with dry-run arguments expects a client to be configured

To Reproduce
Steps to reproduce the behavior:

  1. Installed promtail version 1.4.0
  2. Ran cat eventrouter.log | ./promtail -config.file promtail.yaml -dry-run

Expected behavior
Expected to see the log line how it will be passed to loki

Environment:

cat eventrouter.log
{"log":"I0406 15:50:11.766875       1 glogsink.go:42] {\"verb\":\"ADDED\",\"event\":{\"metadata\":{\"name\":\"minikube.16034541d120b660\",\"namespace\":\"default\",\"selfLink\":\"/api/v1/namespaces/default/events/minikube.16034541d120b660\",\"uid\":\"1d128c8b-fb24-4919-9fb1-789057bc0b77\",\"resourceVersion\":\"10931185\",\"creationTimestamp\":\"2020-04-06T15:40:42Z\"},\"involvedObject\":{\"kind\":\"Node\",\"name\":\"minikube\",\"uid\":\"322204d2-2ed6-44e3-b6c6-9e036633abbb\"},\"reason\":\"RegisteredNode\",\"message\":\"Node minikube event: Registered Node minikube in Controller\",\"source\":{\"component\":\"node-controller\"},\"firstTimestamp\":\"2020-04-06T15:40:42Z\",\"lastTimestamp\":\"2020-04-06T15:40:42Z\",\"count\":1,\"type\":\"Normal\",\"eventTime\":null,\"reportingComponent\":\"\",\"reportingInstance\":\"\"}}\n","stream":"stderr","time":"2020-04-06T15:50:11.767013811Z"}

Screenshots, Promtail config, or terminal output

cat event.log |./promtail -config.file promtail.yaml -dry-run
level=error ts=2020-04-06T16:17:13.377462255Z caller=main.go:63 msg="error creating promtail" error="at least one client config should be provided"
cat promtail.yaml
scrape_configs:
- job_name: test-job
  pipeline_stages:
    - docker: {}

I took the instructions from the releases page, for v 1.4.0, but maybe I am missing something. I would have expected promtail to just parse the input and output what would be fed to loki, but without actually configuring any loki clients

@cyriltovena
Copy link
Contributor

You need at least an url for dry-run

try

cat event.log | ./promtail --config.file=promtail.yaml --dry-run --client.url=http://foo/

Are you using linux ? if so careful with the issue below.

#1892

I think @slim-bean will release a 1.4.1

@aronneagu
Copy link
Author

Yes, I am using Linux. I have tried adding in a -client.url localhost:8080 (with netcat listening on that port) but no luck. I will try on Windows and report back.
By the way, do the cli arguments need one
dash or two dashes? promtail - h shows args with one dash

@cyriltovena
Copy link
Contributor

cyriltovena commented Apr 6, 2020 via email

@aronneagu
Copy link
Author

Awesome, looking forward for the new release. Thanks for the lightning fast replies

You are doing an amazing work with loki and promtail.

cyriltovena pushed a commit to cyriltovena/loki that referenced this issue Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants