Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,11 @@ databases:

#### OCI Vault CLI Configuration

If using the default database with CLI parameters, the exporter will read the password from a secret stored in OCI Vault if you set these two environment variables:
If using the default database with CLI parameters, the exporter will read the username and password from a secret stored in OCI Vault if you set these two environment variables:

- `OCI_VAULT_ID` should be set to the OCID of the OCI vault that you wish to use
- `OCI_VAULT_SECRET_NAME` should be set to the name of the secret in the OCI vault which contains the database password
- `OCI_VAULT_USERNAME_SECRET` should be set to the name of the secret in the OCI vault which contains the database username
- `OCI_VAULT_PASSWORD_SECRET` should be set to the name of the secret in the OCI vault which contains the database password

> Note that the process must be running under a user that has the OCI CLI installed and configured correctly to access the desired tenancy and region. The OCI Profile used is `DEFAULT`.

Expand Down
7 changes: 3 additions & 4 deletions collector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,9 @@ func (m *MetricsConfiguration) defaultDatabase(cfg *Config) DatabaseConfig {
if ociVaultID, useOciVault := os.LookupEnv("OCI_VAULT_ID"); useOciVault {
dbconfig.Vault = &VaultConfig{
OCI: &OCIVault{
ID: ociVaultID,
// For the CLI, only the password may be loaded from a secret. If you need to load
// both the username and password from OCI Vault, use the exporter configuration file.
PasswordSecret: os.Getenv("OCI_VAULT_SECRET_NAME"),
ID: ociVaultID,
UsernameSecret: os.Getenv("OCI_VAULT_USERNAME_SECRET"),
PasswordSecret: os.Getenv("OCI_VAULT_PASSWORD_SECRET"),
},
}
} else if azVaultID, useAzVault := os.LookupEnv("AZ_VAULT_ID"); useAzVault {
Expand Down