From c005761cedb76542283ad554ec2e4450c75a018b Mon Sep 17 00:00:00 2001 From: Barak Amar Date: Tue, 19 Nov 2024 18:49:57 +0200 Subject: [PATCH] Fix desktop endpoint set by browser flag (#153) This pull request fixes an issue where the desktop endpoint was not correctly set by the browser flag. By passing --browser to the configuration, the application now listens on the specified request port, ensuring proper handling of desktop requests. Close #154 --- desktopcollector/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktopcollector/main.go b/desktopcollector/main.go index b05a27e..adc1194 100644 --- a/desktopcollector/main.go +++ b/desktopcollector/main.go @@ -64,6 +64,7 @@ func newCommand(set otelcol.CollectorSettings) *cobra.Command { `yaml:receivers::otlp::protocols::http::endpoint: ` + hostFlag + `:` + strconv.Itoa(httpPortFlag), `yaml:receivers::otlp::protocols::grpc::endpoint: ` + hostFlag + `:` + strconv.Itoa(grpcPortFlag), `yaml:exporters::desktop:`, + `yaml:exporters::desktop::endpoint: ` + hostFlag + `:` + strconv.Itoa(browserPortFlag), `yaml:service::pipelines::traces::receivers: [otlp]`, `yaml:service::pipelines::traces::exporters: [desktop]`, `yaml:service::pipelines::metrics::receivers: [otlp]`, @@ -85,4 +86,5 @@ func newCommand(set otelcol.CollectorSettings) *cobra.Command { rootCmd.Flags().IntVar(&browserPortFlag, "browser", 8000, "The port number where we expose our data") rootCmd.Flags().StringVar(&hostFlag, "host", "localhost", "The host where we expose our all endpoints (OTLP receivers and browser)") return rootCmd -} \ No newline at end of file +} +