Set the environment variables
This milestone happens on your machine, not in Grafana Cloud. The SDK reads five AGENTO11Y_ environment variables when you create the client, so set them in the shell or process that runs your agent.
Open a terminal on the machine where you run your agent. Stay in this terminal for the rest of this milestone and for Milestone 5.
Copy the following commands into that terminal, but don’t run them yet.
exportsets each variable in that shell so the SDK can read it when you create the client.export AGENTO11Y_ENDPOINT="{AGENTO11Y_ENDPOINT}" export AGENTO11Y_PROTOCOL=http export AGENTO11Y_AUTH_MODE=basic export AGENTO11Y_AUTH_TENANT_ID="{AGENTO11Y_INSTANCE_ID}" export AGENTO11Y_AUTH_TOKEN="{ACCESS_POLICY_TOKEN}"Replace the placeholders in those commands.
Run the commands, then keep this shell open. Milestone 5 runs the sample from the same shell, so the client is created after the variables are set. If you use a secret manager or an untracked
.envfile instead ofexport, load it in the same way before you run the agent.
The five variables are set in the shell that will run your agent.