Path

Export the five AGENTO11Y_ environment variables with basic authentication so the SDK client reads them when it is created.

Estimated time: 2 min

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.

  1. 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.

  2. Copy the following commands into that terminal, but don’t run them yet. export sets each variable in that shell so the SDK can read it when you create the client.

    Bash
    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}"
  3. Replace the placeholders in those commands.

    VariableValueWhere it came from
    AGENTO11Y_ENDPOINTAPI URLMilestone 2
    AGENTO11Y_PROTOCOLhttpFixed value for Grafana Cloud
    AGENTO11Y_AUTH_MODEbasicFixed value; the mode documented for Grafana Cloud
    AGENTO11Y_AUTH_TENANT_IDInstance IDMilestone 2
    AGENTO11Y_AUTH_TOKENThe access policy token (glc_...)Milestone 3
  4. 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 .env file instead of export, load it in the same way before you run the agent.

The five variables are set in the shell that will run your agent.