Want to deprecate an API? Use Pixie to quickly determine:
- Is this endpoint used?
- Who is using this endpoint?
Can I deprecate this endpoint? is the accompanying blog post for this demo.
- If you don't already have one, set up a Kubernetes cluster.
- Install Pixie to your Kubernetes cluster.
- Install the Pixie CLI if you didn't install it in order to deploy Pixie in the step above.
- git clone this repository and
cd
into theendpoint-deprecation
folder.
- Install hey. Homebrew users can use:
brew install hey
- Deploy an echo server to receive arbitrary client requests:
# echo-service will be created in the `default` namespace.
kubectl apply -f demo-app.yaml
- Get the external IP for
echo-service
and save it in an environment variable:
kubectl get services
export ECHO_SERVICE_IP=<EXTERNAL IP>
- Run the test load.
-H
is used to pass a custom HTTP header.
for i in {1..15}; do
hey -H "Referer:https://example.com/" -H "API-KEY:abcdef12345" -n 550 "http://${ECHO_SERVICE_IP}/v1/catalog/"
hey -H "Referer:https://px.dev/" -H "API-KEY:lkjlsdfsdfs" -n 50 "http://${ECHO_SERVICE_IP}/v1/catalog/$(uuidgen)/details"
hey -H "Referer:https://example.com/" -H "API-KEY:abcdef12345" -n 50 "http://${ECHO_SERVICE_IP}/v1/catalog/$(uuidgen)/details"
hey -H "Referer:https://example.com/" -H "API-KEY:sdfsdfsdfsd" -n 50 "http://${ECHO_SERVICE_IP}/v1/catalog/$(uuidgen)/details"
hey -H "Referer:https://google.com/" -H "API-KEY:sdfsdfsdfsd" -n 50 "http://${ECHO_SERVICE_IP}/v2/catalog/$(uuidgen)"
done
From the top-level endpoint-deprecation
folder, run:
px live -f service_endpoints_summary -- -start_time '-30m' -service 'default/echo-service'
This PxL sript takes a service
argument. Note that Pixie formats service names in the <namespace>/<service>
format.
To see timeseries graphs for endpoint latency, error and throughput, run the following command and then click the Live View
link at the top:
px live pxbeta/service_endpoints -- -start_time '-30m' -service 'default/echo-service'
From the top-level endpoint-deprecation
folder, run:
px live -f service_requests -- -start_time '-30m' -service 'default/echo-service'
From the top-level endpoint-deprecation
folder, run:
px live -f service_endpoint_requests -- -start_time '-30m' -service 'default/echo-service' -endpoint '/v1/catalog/*/details'
To inspect truncated table cells (e.g. req_headers
), select the cell then press enter
. To exit the expanded view, use esc
.
From the top-level endpoint-deprecation
folder, run:
px live -f unique_req_header_values -- -start_time '-30m' -service 'default/echo-service' -endpoint '/v1/catalog/*/details'
This script only examines two request header fields (Referer and Api-Key), but the .pxl
file can be easily modified to inspect other fields.
For more information, check out the reference docs.
To learn how to run these scripts using the Live UI (instead of the CLI), check out the reference docs.
Feel free to file a bug or an issue for a feature request. You can also join our Slack community.