-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Expose GatewayServices endpoint in HTTP API #8099
Conversation
7a8c761
to
15135d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments from initially looking over the code.
I was slightly concerned about the big rename of ServiceID
-> ServiceName
potentially causing some changes in other API return values, but from going through the rename it looks like everything that was changed was just internal bookkeeping. No return values of state store methods/endpoints changed. 👍
As for the API endpoint, /v1/catalog/gateway-services/
lines up nicely with /v1/catalog/node-services/
. The other potential I thought of was /v1/connect/gateway-services/
, since it relates to service mesh, but no strong opinions there.
Will test it out locally next.
Thinking more, I do wonder if Going by current conventions, I think |
Great points @chrino. I think on the whole Since the use-case here is different it makes sense to me that the format is different since we are querying for a mapping - it's close to the So yeah, didn't read all the diff yet but the API decision here LGTM 👍 . |
43ef5a6
to
cd927ee
Compare
| `consul.client.api.success.catalog_gateway_services.` | This increments whenever a Consul agent successfully responds to a request to list services associated with a gateway. | requests | counter | | ||
| `consul.client.rpc.error.catalog_gateway_services.` | This increments whenever a Consul agent receives an RPC error for a request to list services associated with a gateway. | errors | counter | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have mismatched docs and implementations here, I think we probably want 3 metrics here, like catalog_node_services
:
consul.client.api.catalog_gateway_services.
consul.client.api.error.catalog_gateway_services.
consul.client.api.sucess.catalog_gateway_services.
The docs have success
and error
, while the implementation has consul.client.api.catalog_gateway_services.
and error
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, tested it out locally and it looks good. 1 remaining comment around making sure to add the success
metric for the endpoint and updated the telemetry docs, but otherwise looks good to me. 👍
This PR moves the GatewayServices out of internal and into the Catalog API.
The reason for doing this is to facilitate 3rd party integrations, such as when proxies other than Envoy wish to be configured as a gateway for Consul's service mesh. This is the endpoint we use internally to determine what services an ingress/terminating gateway will route to.
There were a few things that needed to happen, so this is best consumed by commit:
structs.ServiceID
to usestructs.ServiceName
(mostly plumbing). This was because the JSON output of ServiceID has the following fields, which could cause confusion when users expect a service name:Remaining TODO: