Run the guacgql HTTP server on only one port #1805
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the PR
Currently, if I check out
main
and rungo run ./cmd/guacgql --gql-debug
, then I will be able to access/
(playground),/query
(GQL server), and/metrics
on both ports 8080 and 9091 of localhost. I don't think that this makes sense so I have changed the behavior in this PR so that all of these paths are served off of just one port.To test this change, run each of the following commands in a terminal tab:
docker run -p 4222:4222 -p 8222:8222 nats -m 8222 -js
go run ./cmd/guacgql --gql-debug
go run ./cmd/guaccsub
go run ./cmd/guaccollect deps_dev
Then you will be able to access the GraphQL playground on http://localhost:8080, the GraphQL server metrics endpoint on http://localhost:8080/metrics, and the guaccollect deps.dev collector metrics on http://localhost:9091/metrics.
In addition, you may add a
--gql-listen-port nnn
to the second command and see the port for the GraphQL URLs change to nnn, and/or add a--prometheus-port mmm
to the fourth command and see the port for the collector metrics change to mmm.PR Checklist
-s
flag togit commit
.make generate
has been runmake generate
has been runcollectsub
protobuf has been changed,make proto
has been run