Python installation instructions

Use the installation instructions below if you're installing Helios in a standard Python service.

Installing Helios in your Python microservice

Navigate to your project's root directory, and install the latest Helios OpenTelemetry SDK:

pip install helios-opentelemetry-sdk

Configuring Helios through environment variables

Define the following environment variables when running your service:

export AUTOWRAPT_BOOTSTRAP=helios # TODO: Variable should be set before process starts.
export HS_TOKEN=<API_TOKEN> # TODO: Replace value with API token from Helios.
export HS_SERVICE_NAME=<SERVICE_NAME> # TODO: Replace value with service name.
export HS_ENVIRONMENT="<ENVIRONMENT_NAME>" # TODO: Replace value with service environment.

Configuring Helios in the code

Alternatively, it is possible to configure Helios in the code itself.
In your project's **init**.py file, paste the following code snippet before all other imports:

from helios import initialize

initialize(
    api_token=<API_TOKEN>,        # TODO: Insert API token from Helios.
    service_name=<SERVICE_NAME>,  # TODO: Insert service name.
    enabled=True,                 # Defaults to False if omitted.
    environment=<ENVIRONMENT>,    # Defaults to os.environ.get('DEPLOYMENT_ENV') if omitted.
    commit_hash=<COMMIT_HASH>,    # Defaults to os.environ.get('COMMIT_HASH') if omitted.
)

See more configuration options here.

πŸ‘

All set

After setup is complete and once the service is up and running, it will show up in the Helios application.

Troubleshooting tips

Installing the Helios OpenTelemetry SDK is usually a simple process; nonetheless, we've aggregated here some useful tips based on common issues we've encountered in the field so that you can complete the installation quickly.

Turn debug mode on

The Helios SDK support a debug mode through the environment variable HS_DEBUG.
Once debug mode is enabled, search for the Helios initialization prints. This will help verify (or refute) the successful installation of Helios in your microservice.


Did this page help you?