Environment variables
To improve the security and operationalization of your workflow, you can use the following Neptune environment variables:
Environment variable name | Description | Default (if not set) | Example value |
---|---|---|---|
NEPTUNE_API_TOKEN | Neptune API token | - | h0dHBzOi8aHR06E0Z...jMifQ== |
NEPTUNE_PROJECT | Neptune project name | - | team-alpha/project-x |
NEPTUNE_DEBUG_MODE | Sets Neptune to debug mode for troubleshooting purposes | False | True |
NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE | Whether to allow self-signed certificates | False | True |
NEPTUNE_VERIFY_SSL | Whether to allow self-signed certificates | False | True |
NEPTUNE_SKIP_NON_FINITE_METRICS | Skip non-finite metric values instead of raising an error | True | False |
NEPTUNE_DISABLE_COLORS | Disables coloring of console output | False | True |
NEPTUNE_FETCHER_MAX_WORKERS | Controls the number of workers in the thread pool | 32 | 10 |
NEPTUNE_WARN_AT_DATAFRAME_SIZE | Controls how Neptune warns of large fetching results | 1_000_000 | 0 |
Note on SSL (Self-Signed Certificate) configuration
The Neptune API currently consists of two Python packages:
- neptune-scale, for logging metadata to Neptune.
- neptune-fetcher, for fetching logged metadata from Neptune.
The NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE
of neptune-scale corresponds to the NEPTUNE_VERIFY_SSL
environment variable of neptune-fetcher. We plan to unify these, but for now, you must set each of them separately.
NEPTUNE_API_TOKEN
Python packages: neptune-scale, neptune-fetcher
The API token is used for authentication. It's like a password to the application, so you should always keep it secret. For details, see API tokens.
If you don't provide the api_token
argument to a Neptune function, the value of this environment variable is used.
To find and set your API token:
-
In the bottom-left corner of the app, expand your user menu.
-
Select Get Your API token.
-
Depending on your system:
- Linux
- macOS
- Windows
From the API token dialog in Neptune, copy the export command and append the line to your
.profile
or other shell initialization file.Example lineexport NEPTUNE_API_TOKEN="uyVrZXkiOiIzNTd..."
From the API token dialog in Neptune, copy the export command and append the line to your
.profile
or other shell initialization file.Example lineexport NEPTUNE_API_TOKEN="uyVrZXkiOiIzNTd..."
a. From the API token dialog in Neptune, copy the
setx
command.Example linesetx NEPTUNE_API_TOKEN "uyVrZXkiOiIzNTd..."
b. Open a terminal app, such as PowerShell or Command Prompt.
c. Paste the line you copied and press enter.
d. To activate the change, restart the terminal app.
You can also navigate to Settings → Edit the system environment variables and add the variable there.
NEPTUNE_PROJECT
Python packages: neptune-scale, neptune-fetcher
The Neptune project where new runs are created and metadata is fetched from.
If you don't provide the project
argument to a Neptune function, the value of this environment variable is used.
The project path is given in the form workspace-name/project-name
. To find and set your project name:
-
In the Neptune app, open the project menu ().
-
From the dropdown, select Settings.
NEPTUNE_DEBUG_MODE
Python package: neptune-scale
When this environment variable is set to True
, Neptune logs debug information into neptune.NUMBER.log
files.
Use for debugging and troubleshooting purposes.
NEPTUNE_VERIFY_SSL
Python package: neptune-fetcher
In some infrastructure setups, you may encounter problems connecting to Neptune because of the SSL certificate configuration. This can happen if, for example:
- You are in a corporate network, behind a proxy that inspects traffic between your runs and Neptune SaaS.
- The SSL/TLS certificate of your self-hosted installation is not recognized by Python by default.
- The software on your machine is not up to date.
The above problems may result in a NeptuneConnectionLostError
. To solve it, open a terminal and set the NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE
and NEPTUNE_VERIFY_SSL
environment variables to True
.
NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE
Python package: neptune-scale
See NEPTUNE_VERIFY_SSL
.
NEPTUNE_SKIP_NON_FINITE_METRICS
Python package: neptune-scale
If you attempt to log non-finite metric values, such as NaN
or Inf
, Neptune skips such values without erroring by default. To make Neptune raise an exception instead, set this environment variable to False
.
NEPTUNE_DISABLE_COLORS
Python package: neptune-scale
To remove the coloring of Neptune console output, such as warnings and other messages printed in the terminal, set this environment variable to True
.
NEPTUNE_FETCHER_MAX_WORKERS
Python package: neptune-fetcher
Controls the number of workers in the thread pool, when using the use_threads
parameter of the prefetch_series_values()
method.
The default number is 32.
NEPTUNE_WARN_AT_DATAFRAME_SIZE
Python package: neptune-fetcher
Requesting a very large dataset might result in long data fetching. Neptune shows a warning if the number of entries exceeds 1 000 000 (one million).
Use this environment variable to set the warning threshold.
To disable the warning, set the environment variable to 0
.