fix: Use dynamic port in Makefile start output#195
fix: Use dynamic port in Makefile start output#195JohannesMahne wants to merge 1 commit intoelastic:mainfrom
Conversation
Query the actual port from Docker instead of hardcoding 8080, so the displayed URLs respect ENVOY_PORT overrides in .env.override.
2fc291c to
58bc547
Compare
| @PORT=$$(docker port frontend-proxy | head -1 | sed 's/.*://'); \ | ||
| echo "Go to http://localhost:$$PORT for the demo UI."; \ | ||
| echo "Go to http://localhost:$$PORT/jaeger/ui for the Jaeger UI."; \ | ||
| echo "Go to http://localhost:$$PORT/grafana/ for the Grafana UI."; \ | ||
| echo "Go to http://localhost:$$PORT/loadgen/ for the Load Generator UI."; \ | ||
| echo "Go to http://localhost:$$PORT/feature/ to change feature flags." |
There was a problem hiding this comment.
Note that this will hide any failures (e.g. docker port frontend-proxy) inside the pipeline and continue execution. If more robust error handling is needed, there are multiple options (e.g. use bash and pipefail) but the simplest is to lift this logic outside the Makefile into its own shell script, add error handling there, and call that from the Makefile.
|
This is a change on something that is not elastic-specific. It should be upstreamed to avoid conflicts when merging. |
|
Thanks for the change @JohannesMahne , I agree with @dmathieu here, this repo is a fork of https://github.com/open-telemetry/opentelemetry-demo, if changes are needed to none elastic files its advised to make the change upstream in https://github.com/open-telemetry/opentelemetry-demo. |
|
100% - thank you for all the replies. I will look into the upstream repo and also #195 (comment). |

Summary
make startoutputENVOY_PORToverrides in.env.overrideTest plan
ENVOY_PORT=8888in.env.overridemake starthttp://localhost:8888instead of hardcoded8080