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

log-level param is ignored #116

Open
cforce opened this issue Jul 10, 2023 · 2 comments
Open

log-level param is ignored #116

cforce opened this issue Jul 10, 2023 · 2 comments

Comments

@cforce
Copy link

cforce commented Jul 10, 2023

It shall not print indo logs

otelgen --otel-exporter-otlp-endpoint localhost:4318 --protocol http --insecure --service-name otelgen --log-level warn --duration 30 metrics counter
{"level":"info","ts":1689025485.5422175,"caller":"cli/metrics_root.go:132","msg":"using","temporarility":"delta"}
{"level":"info","ts":1689025485.5423172,"caller":"cli/metrics_root.go:77","msg":"starting HTTP exporter"}
{"level":"info","ts":1689025485.542361,"caller":"cli/metrics_counter.go:58","msg":"Starting metrics generation"}
{"level":"error","ts":1689025485.542427,"caller":"metrics/worker.go:50","msg":"either `metrics` or `duration` must be greater than 0","stacktrace":"github.com/krzko/otelgen/internal/metrics.(*Worker).Run\n\t/home/runner/work/otelgen/otelgen/internal/metrics/worker.go:50\ngithub.com/krzko/otelgen/internal/metrics.run\n\t/home/runner/work/otelgen/otelgen/internal/metrics/worker.go:38\ngithub.com/krzko/otelgen/internal/metrics.SimulateCounter\n\t/home/runner/work/otelgen/otelgen/internal/metrics/counter.go:16\ngithub.com/krzko/otelgen/internal/cli.generateMetricsCounterAction\n\t/home/runner/work/otelgen/otelgen/internal/cli/metrics_counter.go:67\ngithub.com/krzko/otelgen/internal/cli.glob..func1\n\t/home/runner/work/otelgen/otelgen/internal/cli/metrics_counter.go:27\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:274\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:267\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:267\ngithub.com/urfave/cli/v2.(*App).RunContext\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:332\ngithub.com/urfave/cli/v2.(*App).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:309\nmain.main\n\t/home/runner/work/otelgen/otelgen/cmd/otelgen/main.go:19\nruntime.main\n\t/opt/hostedtoolcache/go/1.19.9/x64/src/runtime/proc.go:250"}    
{"level":"error","ts":1689025485.5424926,"caller":"metrics/counter.go:18","msg":"failed to run counter","error":"failed to run worker: either `metrics` or `duration` must be greater than 0","stacktrace":"github.com/krzko/otelgen/internal/metrics.SimulateCounter\n\t/home/runner/work/otelgen/otelgen/internal/metrics/counter.go:18\ngithub.com/krzko/otelgen/internal/cli.generateMetricsCounterAction\n\t/home/runner/work/otelgen/otelgen/internal/cli/metrics_counter.go:67\ngithub.com/krzko/otelgen/internal/cli.glob..func1\n\t/home/runner/work/otelgen/otelgen/internal/cli/metrics_counter.go:27\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:274\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:267\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/command.go:267\ngithub.com/urfave/cli/v2.(*App).RunContext\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:332\ngithub.com/urfave/cli/v2.(*App).Run\n\t/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.25.3/app.go:309\nmain.main\n\t/home/runner/work/otelgen/otelgen/cmd/otelgen/main.go:19\nruntime.main\n\t/opt/hostedtoolcache/go/1.19.9/x64/src/runtime/proc.go:250"}
{"level":"info","ts":1689025485.5425222,"caller":"cli/metrics_root.go:192","msg":"stopping the exporter"}
otelgen --otel-exporter-otlp-endpoint localhost:4317 --protocol grpc --insecure --service-name otelgen --log-level warn --du
@cforce
Copy link
Author

cforce commented Jul 19, 2023

@krzko
--duration=30 -> error, duration can't be 0
--duration=0 -> ok, works, but uses default value of 24 hours to run test

@tjuchniewicz
Copy link

tjuchniewicz commented Jul 20, 2023

So we have two problems in this ticket:

  1. log-level param is ignored
  2. --duration 30 does not work

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