馃敟 Missed the Bindplane Launch Week? Get caught up on everything we announced! 馃敟Explore now

Using Environment Variables

Using Environment Variables in Bindplane

Environment variables enable secure credential management in Bindplane by leveraging the OpenTelemetry Collector's environment variable substitution capabilities. This approach ensures sensitive values remain outside of the platform's storage.

Overview

Bindplane supports environment variable references in collector configurations through the standard ${ENV_VAR} syntax. During deployment, these references are automatically resolved to their corresponding values in the collector agent's runtime environment.

note

Environment variable values remain exclusively within your deployment environment and are not persisted in Bindplane's database.

note

Proper configuration of environment variables on agent hosts is essential. Misconfigured variable names or values may lead to deployment failures or pipeline execution errors.

Implementation Guide

Step 1: Configuration Setup

Create or modify collector configurations in the Bindplane UI by incorporating environment variable references for sensitive values.

Screenshot showing environment variable configuration in Bindplane UI

Step 2: Environment Configuration

Configure the required environment variables on all systems hosting OpenTelemetry collectors.

For Linux systems:

bash
1# This will set the Environment Variables for the scope of your shell session.
2# To persist them, you will need to add them to your .bashrc or .zshrc files.
3export DB_HOST=db.example.com
4export DB_USER=collector_user
5export DB_PASSWORD=your-secure-password
6export DB_NAME=metrics_db

For Windows systems:

powershell
1# To set scoped environment variables to the powershell session
2$env:DB_HOST="db.example.com"
3$env:DB_USER="collector_user"
4$env:DB_PASSWORD="your-secure-password"
5$env:DB_NAME="metrics_db"
6
7# To set machine scoped environment variables permanently
8[Environment]::SetEnvironmentVariable('DB_HOST', 'db.example.com', 'Machine')
9[Environment]::SetEnvironmentVariable('DB_USER', 'collector_user', 'Machine')
10[Environment]::SetEnvironmentVariable('DB_PASSWORD', 'your-secure-password', 'Machine')
11[Environment]::SetEnvironmentVariable('DB_NAME', 'metrics_db', 'Machine')
12
13# To set the Environment Variable via the Registry, you can use the following:
14reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\observiq-otel-collector" /v Environment /t REG_MULTI_SZ /d "DB_HOST="db.example.com" /f

For additional information about Windows Environment Variables in PowerShell, consult the Microsoft PowerShell documentation.

Step 3: Deployment and Validation

Deploy the configuration through Bindplane and validate collector functionality with the configured environment variables.

Implementation Best Practices

  1. Naming Conventions: Implement clear, descriptive environment variable names (e.g., DB_MYSQL_PASSWORD rather than PASSWORD)
  2. Documentation: Maintain comprehensive documentation of required environment variables for each collector configuration
  3. Access Control: Implement appropriate permissions to restrict environment variable access to authorized collector service accounts
  4. Deployment Automation: Incorporate environment variable configuration into deployment automation or service definitions
  5. Security Integration: Consider integrating with enterprise secrets management solutions for automated environment variable population