Skip to main content
App version: 3.4.6

Environment variables

To improve the security and operationalization of your workflow, you can use the following Neptune environment variables:

Environment variable nameDescriptionDefault (if not set)Example value
NEPTUNE_API_TOKENNeptune API token-h0dHBzOi8aHR06E0Z...jMifQ==
NEPTUNE_PROJECTNeptune project name-team-alpha/project-x
NEPTUNE_DEBUG_MODESets Neptune to debug mode for troubleshooting purposesFalseTrue
NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATEWhether to allow self-signed certificatesFalseTrue
NEPTUNE_VERIFY_SSLWhether to allow self-signed certificatesFalseTrue
NEPTUNE_SKIP_NON_FINITE_METRICSSkip non-finite metric values instead of raising an errorTrueFalse
NEPTUNE_DISABLE_COLORSDisables coloring of console outputFalseTrue
NEPTUNE_FETCHER_MAX_WORKERSControls the number of workers in the thread pool3210
NEPTUNE_WARN_AT_DATAFRAME_SIZEControls how Neptune warns of large fetching results1_000_0000
NEPTUNE_LOG_MAX_BLOCKING_TIME_SECONDSIn seconds, how long the main process should block before giving upinfinity1800
NEPTUNE_LOG_FAILURE_ACTIONWhat should happen if the main process gives up: drop the data or raise an exceptiondropraise
Note on SSL (Self-Signed Certificate) configuration

The Neptune API currently consists of two Python packages:

The NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE variable of neptune-scale corresponds to the NEPTUNE_VERIFY_SSL 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:

  1. In the bottom-left corner of the app, expand your user menu.

  2. Select Get Your API token.

    How to find your Neptune API token

  3. Depending on your system:

    From the API token dialog in Neptune, copy the export command and append the line to your .profile or other shell initialization file.

    Example line
    export NEPTUNE_API_TOKEN="uyVrZXkiOiIzNTd..."

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:

  1. In the Neptune app, open the project menu ().

  2. From the dropdown, select Settings.

    Project menu in the Neptune app.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_PROJECT=team-alpha/project-x

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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_DEBUG_MODE=True

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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_ALLOW_SELF_SIGNED_CERTIFICATE=True

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_VERIFY_SSL=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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_SKIP_NON_FINITE_METRICS=False

NEPTUNE_LOG_MAX_BLOCKING_TIME_SECONDS

Python package: neptune-scale

Sometimes the main process can get stuck when the Neptune sync process stops consuming messages. Use this environment variable to control how long the main process blocks before giving up.

By default, the process waits indefinitely. Depending on your tolerance for delays, we recommend setting the duration to 10–60 minutes.

If the queue is full, the main process waits only once. On future attempts, it won't block unless it manages to log data in between. In this case, the timer resets.

To control what happens when the process gives up, use the related NEPTUNE_LOG_FAILURE_ACTION environment variable.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_LOG_MAX_BLOCKING_TIME_SECONDS=1800

NEPTUNE_LOG_FAILURE_ACTION

Python package: neptune-scale

If the main process gets stuck and gives up after the duration specified by NEPTUNE_LOG_MAX_BLOCKING_TIME_SECONDS, use this variable to control what happens:

  • drop (default) → Drop the data and log an error to stdout.
  • raise → Raise the NeptuneUnableToLogData exception.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_LOG_FAILURE_ACTION=raise

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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_DISABLE_COLORS=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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_FETCHER_MAX_WORKERS=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.

Append a line with the export command to your .profile or other shell initialization file:

export NEPTUNE_WARN_AT_DATAFRAME_SIZE=0