Astra-cli is a wrapper tool around docker to manage astra-proxy-service on the fly. It can be used to setup and manage the astra-proxy-service by launching this proxy service as a container. This guide will cover how to use astra-cli to manage astra-proxy-service. It also covers troubleshooting common issues encountered for astra-proxy-service.

|| astra-proxy-service makes use of well known mitmproxy as upstream proxy server. This service by default doesn't verify the upstream certificates and hence the certificate verification is left to the application

Download astra-cli from repository

  1. Refer here to get started with astra-cli integration

Manage astra-proxy-service by using astra-cli

  1. Environment file is mandatory for the astra-proxy-service to start

SENSOR_ID is the integrationID displayed in the integrations page of getastra
ALLOWED_HOSTS is the comma separated list of FQDNs. Minimum one, maximum five comma separated FQDNs can be given. OTEL_EXPORTER_ENDPOINT is the address of the astra-traffic-collector

SENSOR_ID=f0dd7367-5f66-4c1b-bd73-74da8a5b78a6
ALLOWED_HOSTS=mydomain.dev, mydomain.com, testing.com
OTEL_EXPORTER_ENDPOINT=localhost:4317
  1. Start the astra-proxy-service container under quickstart mode

--listen-port : will set the port on which http proxy should be listening to --env-file : will set the env file to read from

./astra-cli proxy quickstart --listen-port 8181 --env-file proxyEnv
  1. Start the astra-proxy-service with additional flags

./astra-cli proxy start --env-file .env --rm -p 8080:8181
  1. Check the status of astra-proxy-service

./astra-cli proxy status
CONTAINER ID   IMAGE            COMMAND                  CREATED          STATUS          PORTS                                                 NAMES
4e0090bb1ae9   getastra/proxy   "mitmdump -k -s /app…"   35 minutes ago   Up 35 minutes   8080/tcp, 0.0.0.0:8080->8181/tcp, :::8080->8181/tcp   astra-proxy-service
  1. Check the logs of astra-proxy-service

./astra-cli proxy logs
./astra-cli proxy logs --tail=0 -f
./astra-cli proxy logs --since=5m
  1. To stop astra-proxy-service

./astra-cli proxy stop
  1. To stop astra-proxy-service

./astra-cli proxy remove

Upgrade

Docker container upgrade

This process updates the docker container to a new version of the astra-proxy-service.

  1. ** Change directory to the place where astra-cli executable is downloaded**

  2. Run below command

./astra-cli proxy upgrade
  1. Upon successfull image pull, run this to stop the current container and subsequently remove it

./astra-cli proxy stop
./astra-cli proxy remove
  1. Restart the container with newly pulled image

./astra-cli proxy quickstart --listen-port 8181 --env-file proxyEnv

Troubleshooting

  1. traces are not captured by astra-proxy-service

Symptoms