From f213a229f482676bfb8b283027dbbf4a73167f73 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 11:47:50 -0400 Subject: [PATCH 01/18] getting ready, rename old vault support, update readme, makefile, etc. Signed-off-by: Mark Nelson --- Makefile | 2 +- README.md | 19 +++++++++++++++---- docker-compose/compose.yaml | 2 +- kubernetes/metrics-exporter-deployment.yaml | 2 +- main.go | 4 ++-- vault/vault.go => ocivault/ocivault.go | 5 +++-- 6 files changed, 23 insertions(+), 11 deletions(-) rename vault/vault.go => ocivault/ocivault.go (98%) diff --git a/Makefile b/Makefile index 1bc1192..d899bd4 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ OS_TYPE ?= $(shell uname -s | tr '[:upper:]' '[:lower:]') ARCH_TYPE ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH))) GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) -VERSION ?= 1.5.5 +VERSION ?= 1.6.0 LDFLAGS := -X main.Version=$(VERSION) GOFLAGS := -ldflags "$(LDFLAGS) -s -w" BUILD_ARGS = --build-arg VERSION=$(VERSION) diff --git a/README.md b/README.md index 5e84672..77b9532 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Contributions are welcome - please see [contributing](CONTRIBUTING.md). - [Kubernetes](#kubernetes) - [Standalone binary](#standalone-binary) - [Using OCI Vault](#using-oci-vault) + - [Using Azure Vault](#using-azure-vault) - [Custom metrics](#custom-metrics) - [Controlling memory usage](#controlling-memory-usage) - [Grafana dashboards](#grafana-dashboards) @@ -29,7 +30,8 @@ Contributions are welcome - please see [contributing](CONTRIBUTING.md). | Release | Date | Changelog | |---------|----------------------|-----------------------------------------------------------------| -| 1.5.5 | March 13th, 2025 | [1.5.5 Changelog](./changelog.md#version-155-march-13-2025) | +| 1.6.0 | March XX, 2025 | [1.6.0 Changelog](./changelog.md#version-160-march-xx-2025) | +| 1.5.5 | March 13th, 2025 | [1.5.5 Changelog](./changelog.md#version-155-march-13-2025) | | 1.5.4 | March 3rd, 2025 | [1.5.4 Changelog](./changelog.md#version-154-march-3-2025) | | 1.5.3 | January 28th, 2025 | [1.5.3 Changelog](./changelog.md#version-153-january-28-2025) | | 1.5.2 | December 2nd, 2024 | [1.5.2 Changelog](./changelog.md#version-152-december-2-2024) | @@ -374,7 +376,7 @@ docker run -it --rm \ -e DB_PASSWORD=Welcome12345 \ -e DB_CONNECT_STRING=free23ai:1521/freepdb \ -p 9161:9161 \ - container-registry.oracle.com/database/observability-exporter:1.5.5 + container-registry.oracle.com/database/observability-exporter:1.6.0 ``` ##### Using a wallet @@ -420,7 +422,7 @@ docker run -it --rm \ -e DB_CONNECT_STRING=devdb_tp \ -v ./wallet:/wallet \ -p 9161:9161 \ - container-registry.oracle.com/database/observability-exporter:1.5.5 + container-registry.oracle.com/database/observability-exporter:1.6.0 ``` > **Note:** If you are using `podman` you must specify the `:z` suffix on the volume mount so that the container will be able to access the files in the volume. For example: `-v ./wallet:/wallet:z` @@ -607,6 +609,15 @@ The exporter will read the password from a secret stored in OCI Vault if you set > 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`. +### Using Azure Vault + +The exporter will read the password from a secret stored in Azure Key Vault if you set these two environment variables: + +- `AZ_VAULT_ID` should be set to the ID of the Azure Key Vault that you wish to use +- `AZ_VAULT_SECRET_NAME` should be set to the name of the secret in the Azure Key Vault which contains the database password + +> Note that the process must be running under a user that has the Azure CLI installed and configured correctly to access the desired tenancy or, if running in Azure, with service principal enabled. + ## Custom metrics The exporter allows definition of arbitrary custom metrics in one or more TOML files. To specify this file to the @@ -715,7 +726,7 @@ An exmaple of [custom metrics for Transacational Event Queues](./custom-metrics- If you run the exporter as a container image and want to include your custom metrics in the image itself, you can use the following example `Dockerfile` to create a new image: ```Dockerfile -FROM container-registry.oracle.com/database/observability-exporter:1.5.5 +FROM container-registry.oracle.com/database/observability-exporter:1.6.0 COPY custom-metrics.toml / ENTRYPOINT ["/oracledb_exporter", "--custom.metrics", "/custom-metrics.toml"] ``` diff --git a/docker-compose/compose.yaml b/docker-compose/compose.yaml index d4fe818..8381974 100644 --- a/docker-compose/compose.yaml +++ b/docker-compose/compose.yaml @@ -43,7 +43,7 @@ services: start_period: 30s exporter: - image: container-registry.oracle.com/database/observability-exporter:1.5.5 + image: container-registry.oracle.com/database/observability-exporter:1.6.0 container_name: exporter # command: # - '--log.level=debug' diff --git a/kubernetes/metrics-exporter-deployment.yaml b/kubernetes/metrics-exporter-deployment.yaml index fff359c..7196733 100755 --- a/kubernetes/metrics-exporter-deployment.yaml +++ b/kubernetes/metrics-exporter-deployment.yaml @@ -17,7 +17,7 @@ spec: spec: containers: - name: metrics-exporter - image: container-registry.oracle.com/database/observability-exporter:1.5.5 + image: container-registry.oracle.com/database/observability-exporter:1.6.0 imagePullPolicy: Always env: # uncomment and customize the next item if you want to provide custom metrics definitions diff --git a/main.go b/main.go index e4c7952..c2f8029 100644 --- a/main.go +++ b/main.go @@ -31,7 +31,7 @@ import ( "github.com/oracle/oracle-db-appdev-monitoring/alertlog" "github.com/oracle/oracle-db-appdev-monitoring/collector" - "github.com/oracle/oracle-db-appdev-monitoring/vault" + "github.com/oracle/oracle-db-appdev-monitoring/ocivault" ) var ( @@ -72,7 +72,7 @@ func main() { if useVault { logger.Info("OCI_VAULT_ID env var is present so using OCI Vault", "vaultOCID", vaultID) - password = vault.GetVaultSecret(vaultID, os.Getenv("OCI_VAULT_SECRET_NAME")) + password = ocivault.GetVaultSecret(vaultID, os.Getenv("OCI_VAULT_SECRET_NAME")) } freeOSMemInterval, enableFree := os.LookupEnv("FREE_INTERVAL") diff --git a/vault/vault.go b/ocivault/ocivault.go similarity index 98% rename from vault/vault.go rename to ocivault/ocivault.go index 10c509b..1384bdf 100755 --- a/vault/vault.go +++ b/ocivault/ocivault.go @@ -1,14 +1,15 @@ // Copyright (c) 2023, 2025, Oracle and/or its affiliates. // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -package vault +package ocivault import ( "context" b64 "encoding/base64" - "github.com/prometheus/common/promslog" "strings" + "github.com/prometheus/common/promslog" + "github.com/oracle/oci-go-sdk/v65/common" "github.com/oracle/oci-go-sdk/v65/example/helpers" "github.com/oracle/oci-go-sdk/v65/secrets" From 4e832ed8d60e3c8b6f4c11aafc2c4fb3d6c8229b Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 11:59:38 -0400 Subject: [PATCH 02/18] initial impl Signed-off-by: Mark Nelson --- azvault/azvault.go | 40 ++++++++++++++++++++++++++++++++++++++++ main.go | 15 +++++++++++---- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100755 azvault/azvault.go diff --git a/azvault/azvault.go b/azvault/azvault.go new file mode 100755 index 0000000..309b3ba --- /dev/null +++ b/azvault/azvault.go @@ -0,0 +1,40 @@ +// Copyright (c) 2023, 2025, Oracle and/or its affiliates. +// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +package ocivault + +import ( + "context" + "fmt" + "strings" + + "github.com/prometheus/common/promslog" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets" +) + +func GetVaultSecret(vaultId string, secretName string) string { + promLogConfig := &promslog.Config{} + logger := promslog.New(promLogConfig) + + logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "vaultID", vaultId) + + vaultURI := fmt.Sprintf("https://%s.vault.azure.net/", vaultId) + + // create a credential + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + logger.Error("Failed to obtain an Azure Credential", "err", err) + } + + // establish a connection to the key vault client + client, err := azsecrets.NewClient(vaultURI, cred, nil) + + // get the secret - empty string version means "latest" + version := "" + resp, err := client.GetSecret(context.TODO(), secretName, version, nil) + + rawSecret := *resp.Value + return strings.TrimRight(rawSecret, "\r\n") // make sure a \r and/or \n didn't make it into the secret +} diff --git a/main.go b/main.go index c2f8029..6733b00 100644 --- a/main.go +++ b/main.go @@ -68,11 +68,18 @@ func main() { // externalAuth - Default to user/password but if no password is supplied then will automagically set to true externalAuth := false - vaultID, useVault := os.LookupEnv("OCI_VAULT_ID") - if useVault { + ociVaultID, useOciVault := os.LookupEnv("OCI_VAULT_ID") + if useOciVault { - logger.Info("OCI_VAULT_ID env var is present so using OCI Vault", "vaultOCID", vaultID) - password = ocivault.GetVaultSecret(vaultID, os.Getenv("OCI_VAULT_SECRET_NAME")) + logger.Info("OCI_VAULT_ID env var is present so using OCI Vault", "vaultOCID", ociVaultID) + password = ocivault.GetVaultSecret(ociVaultID, os.Getenv("OCI_VAULT_SECRET_NAME")) + } + + azVaultID, useAzVault := os.LookupEnv("AZ_VAULT_ID") + if useAzVault { + + logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "VaultID", azVaultID) + password = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_SECRET_NAME")) } freeOSMemInterval, enableFree := os.LookupEnv("FREE_INTERVAL") From 90e4ca69440850fdac5301c655d538ddff039e22 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 12:03:26 -0400 Subject: [PATCH 03/18] first build Signed-off-by: Mark Nelson --- azvault/azvault.go | 2 +- go.mod | 20 +++++++++++---- go.sum | 61 ++++++++++++++++++++++++++++++++-------------- main.go | 1 + 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/azvault/azvault.go b/azvault/azvault.go index 309b3ba..7a9503b 100755 --- a/azvault/azvault.go +++ b/azvault/azvault.go @@ -1,7 +1,7 @@ // Copyright (c) 2023, 2025, Oracle and/or its affiliates. // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -package ocivault +package azvault import ( "context" diff --git a/go.mod b/go.mod index 69ceda7..a47e21c 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,8 @@ go 1.23.0 toolchain go1.23.7 require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 + github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0 github.com/BurntSushi/toml v1.4.0 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/godror/godror v0.47.0 @@ -15,6 +17,10 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -22,23 +28,27 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godror/knownpb v0.1.2 // indirect github.com/gofrs/flock v0.8.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/klauspost/compress v1.17.11 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mdlayher/socket v0.4.1 // indirect github.com/mdlayher/vsock v1.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect - golang.org/x/crypto v0.35.0 // indirect + golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/net v0.36.0 // indirect + golang.org/x/net v0.37.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index d11b022..e10d59d 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,19 @@ +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0 h1:xnO4sFyG8UH2fElBkcqLTOZsAajvKfnSlgBBW8dXYjw= +github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0/go.mod h1:XD3DIOOVgBCO03OleB1fHjgktVRFxlT++KwKgIOewdM= +github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 h1:FbH3BbSb4bvGluTesZZ+ttN/MDsnMmQP36OSnDuSXqw= +github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 h1:8BKxhZZLX/WosEeoCvWysmKUscfa9v8LIPEEU0JjE2o= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/UNO-SOFT/zlog v0.8.1 h1:TEFkGJHtUfTRgMkLZiAjLSHALjwSBdw6/zByMC5GJt4= @@ -15,6 +31,8 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -26,10 +44,16 @@ github.com/godror/knownpb v0.1.2 h1:icMyYsYVpGmzhoVA01xyd0o4EaubR31JPK1UxQWe4kM= github.com/godror/knownpb v0.1.2/go.mod h1:zs9hH+lwj7mnPHPnKCcxdOGz38Axa9uT+97Ng+Nnu5s= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -48,14 +72,12 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid/v2 v2.0.2 h1:r4fFzBm+bv0wNKNh5eXTwU7i85y5x+uwkxCUTNVQqLc= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= -github.com/oracle/oci-go-sdk/v65 v65.84.0 h1:NCEiq42gwrFJPLmIMxz4QnZSM4Wmp6n+sjpznBDg060= -github.com/oracle/oci-go-sdk/v65 v65.84.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/oracle/oci-go-sdk/v65 v65.86.0 h1:vFEguOYWd29j4TEy+BaQsUhMh2TPtfWRfLwQpYaU1wk= github.com/oracle/oci-go-sdk/v65 v65.86.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA= -github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= @@ -66,8 +88,10 @@ github.com/prometheus/exporter-toolkit v0.14.0 h1:NMlswfibpcZZ+H0sZBiTjrA3/aBFHk github.com/prometheus/exporter-toolkit v0.14.0/go.mod h1:Gu5LnVvt7Nr/oqTBUC23WILZepW0nffNo10XdhQcwWA= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= +github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -83,23 +107,24 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= +golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/main.go b/main.go index 6733b00..2fd705b 100644 --- a/main.go +++ b/main.go @@ -30,6 +30,7 @@ import ( // _ "net/http/pprof" "github.com/oracle/oracle-db-appdev-monitoring/alertlog" + "github.com/oracle/oracle-db-appdev-monitoring/azvault" "github.com/oracle/oracle-db-appdev-monitoring/collector" "github.com/oracle/oracle-db-appdev-monitoring/ocivault" ) From 22a6fc448158797f2fa8b4cb904a99c9b12aa9e5 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 12:42:04 -0400 Subject: [PATCH 04/18] working on auth Signed-off-by: Mark Nelson --- azvault/azvault.go | 3 +++ main.go | 1 + 2 files changed, 4 insertions(+) diff --git a/azvault/azvault.go b/azvault/azvault.go index 7a9503b..c25fe9d 100755 --- a/azvault/azvault.go +++ b/azvault/azvault.go @@ -34,6 +34,9 @@ func GetVaultSecret(vaultId string, secretName string) string { // get the secret - empty string version means "latest" version := "" resp, err := client.GetSecret(context.TODO(), secretName, version, nil) + if err != nil { + logger.Error("Failed to get secret from vault", "err", err) + } rawSecret := *resp.Value return strings.TrimRight(rawSecret, "\r\n") // make sure a \r and/or \n didn't make it into the secret diff --git a/main.go b/main.go index 2fd705b..bedecb6 100644 --- a/main.go +++ b/main.go @@ -80,6 +80,7 @@ func main() { if useAzVault { logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "VaultID", azVaultID) + logger.Info("If running outside Azure, set the environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET for the application service principal information to connect to Azure with.") password = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_SECRET_NAME")) } From dbbd9a15e0025bb78e617829977e5df3ac204f11 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 14:04:53 -0400 Subject: [PATCH 05/18] working Signed-off-by: Mark Nelson --- azvault/azvault.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azvault/azvault.go b/azvault/azvault.go index c25fe9d..3049318 100755 --- a/azvault/azvault.go +++ b/azvault/azvault.go @@ -18,8 +18,6 @@ func GetVaultSecret(vaultId string, secretName string) string { promLogConfig := &promslog.Config{} logger := promslog.New(promLogConfig) - logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "vaultID", vaultId) - vaultURI := fmt.Sprintf("https://%s.vault.azure.net/", vaultId) // create a credential @@ -33,11 +31,13 @@ func GetVaultSecret(vaultId string, secretName string) string { // get the secret - empty string version means "latest" version := "" + secret := "" resp, err := client.GetSecret(context.TODO(), secretName, version, nil) if err != nil { logger.Error("Failed to get secret from vault", "err", err) + } else { + secret = *resp.Value } - rawSecret := *resp.Value - return strings.TrimRight(rawSecret, "\r\n") // make sure a \r and/or \n didn't make it into the secret + return strings.TrimRight(secret, "\r\n") // make sure a \r and/or \n didn't make it into the secret } From 6f8bbb2bb45904eb235c901cf91ce42e12b9a521 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 15:11:17 -0400 Subject: [PATCH 06/18] udpate readme with auth details Signed-off-by: Mark Nelson --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 77b9532..750b13d 100644 --- a/README.md +++ b/README.md @@ -616,7 +616,18 @@ The exporter will read the password from a secret stored in Azure Key Vault if y - `AZ_VAULT_ID` should be set to the ID of the Azure Key Vault that you wish to use - `AZ_VAULT_SECRET_NAME` should be set to the name of the secret in the Azure Key Vault which contains the database password -> Note that the process must be running under a user that has the Azure CLI installed and configured correctly to access the desired tenancy or, if running in Azure, with service principal enabled. +#### Authentication + +If you are running the exporter outside Azure, we recommend using [application service principal](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/authentication-on-premises-apps). + +If you are running the exporter inside Azure, we recommend using a [managed identity](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/authentication-azure-hosted-apps). + +You should set the following additional environment variables to allow the exporter to authenticate to Azure: + +- `AZURE_TENANT_ID` should be set to your tenant ID +- `AZURE_CLIENT_ID` should be set to the client ID to authenticate to Azure +- `AZURE_CLIENT_SECRET` should be set to the client secret to authenticate to Azure + ## Custom metrics From 6a3defcb87d06d6182914d76c890a75e49c04009 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 19 Mar 2025 15:14:25 -0400 Subject: [PATCH 07/18] update log message re auth Signed-off-by: Mark Nelson --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index bedecb6..fe0b75c 100644 --- a/main.go +++ b/main.go @@ -80,7 +80,7 @@ func main() { if useAzVault { logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "VaultID", azVaultID) - logger.Info("If running outside Azure, set the environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET for the application service principal information to connect to Azure with.") + logger.Info("Using the environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET to authentication with Azure.") password = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_SECRET_NAME")) } From 7c15bccf3c345cea0565062192589256bc44bf49 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 20 Mar 2025 13:23:58 -0400 Subject: [PATCH 08/18] update tpl: Signed-off-by: Mark Nelson --- THIRD_PARTY_LICENSES.txt | 75 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt index e3db305..c54cb50 100644 --- a/THIRD_PARTY_LICENSES.txt +++ b/THIRD_PARTY_LICENSES.txt @@ -12,6 +12,7 @@ Copyright (c) 2016, 2025, Oracle and/or its affiliates. ----------------------------------- Licenses ----------------------------------- - Apache-2.0 +- BSD-2-Clause - BSD-3-Clause - BSD-3-Clause--modified-by-Google - MIT @@ -19,6 +20,78 @@ Copyright (c) 2016, 2025, Oracle and/or its affiliates. --------------------------------- (separator) ---------------------------------- +== Dependency +github.com/Azure/azure-sdk-for-go/sdk/azcore + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. All rights reserved. +Copyright 2017 Microsoft Corporation. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/Azure/azure-sdk-for-go/sdk/azidentity + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/Azure/azure-sdk-for-go/sdk/internal + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. All rights reserved. +Copyright 2017 Microsoft Corporation. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/AzureAD/microsoft-authentication-library-for-go + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License"). + +--------------------------------- (separator) ---------------------------------- + == Dependency github.com/BurntSushi/toml @@ -1415,4 +1488,4 @@ SOFTWARE. === ATTRIBUTION-HELPER-GENERATED: === Attribution helper version: {Major:0 Minor:11 GitVersion:0.10.0-114-g3747dab9 GitCommit:3747dab92eb29c0dbe6409ffbb824b9ae3a04b87 GitTreeState:clean BuildDate:2024-05-31T13:48:06Z GoVersion:go1.21.4 Compiler:gc Platform:linux/amd64} -=== License file based on go.mod with md5 sum: 771c94b3ddce81ff2e234b02d85209e4 +=== License file based on go.mod with md5 sum: 1f9ef04b4e97726da4230878cc4247bc From b4dc0472118f2b2df7a2c32f73ed18ef77af0fe6 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 08:46:17 -0400 Subject: [PATCH 09/18] get username and password from az key vault Signed-off-by: Mark Nelson --- README.md | 3 ++- main.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 750b13d..c237c5f 100644 --- a/README.md +++ b/README.md @@ -614,7 +614,8 @@ The exporter will read the password from a secret stored in OCI Vault if you set The exporter will read the password from a secret stored in Azure Key Vault if you set these two environment variables: - `AZ_VAULT_ID` should be set to the ID of the Azure Key Vault that you wish to use -- `AZ_VAULT_SECRET_NAME` should be set to the name of the secret in the Azure Key Vault which contains the database password +- `AZ_VAULT_USERNAME_SECRET` should be set to the name of the secret in the Azure Key Vault which contains the database username +- `AZ_VAULT_PASSWORD_SECRET` should be set to the name of the secret in the Azure Key Vault which contains the database password #### Authentication diff --git a/main.go b/main.go index fe0b75c..d7d6d79 100644 --- a/main.go +++ b/main.go @@ -81,7 +81,8 @@ func main() { logger.Info("AZ_VAULT_ID env var is present so using Azure Key Vault", "VaultID", azVaultID) logger.Info("Using the environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET to authentication with Azure.") - password = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_SECRET_NAME")) + user = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_USERNAME_SECRET")) + password = azvault.GetVaultSecret(azVaultID, os.Getenv("AZ_VAULT_PASSWORD_SECRET")) } freeOSMemInterval, enableFree := os.LookupEnv("FREE_INTERVAL") From 4c66512d1e03fe78469a8d86225fcd9a7614d4a0 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 11:19:50 -0400 Subject: [PATCH 10/18] update godror Signed-off-by: Mark Nelson --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a47e21c..a8ee300 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0 github.com/BurntSushi/toml v1.4.0 github.com/alecthomas/kingpin/v2 v2.4.0 - github.com/godror/godror v0.47.0 + github.com/godror/godror v0.48.1 github.com/oracle/oci-go-sdk/v65 v65.86.0 github.com/prometheus/client_golang v1.21.1 github.com/prometheus/common v0.62.0 diff --git a/go.sum b/go.sum index e10d59d..0d277e6 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godror/godror v0.47.0 h1:GZsaMOIvLqgTPPVXFIavRI4mqwNIhmcFfEZbzWeabGE= github.com/godror/godror v0.47.0/go.mod h1:44hxVDzvFSwc+yGyRM+riCLNAY5SwZkUfLzVTh5MXCg= +github.com/godror/godror v0.48.1 h1:kLC7meCy4yWvs0UzzTf0RIqeN+wp7SGXLLLbQfpooPM= +github.com/godror/godror v0.48.1/go.mod h1:7JBa3m6g1s+5cTlZqEvydklDE30Xon3EALNrQm2iwk0= github.com/godror/knownpb v0.1.2 h1:icMyYsYVpGmzhoVA01xyd0o4EaubR31JPK1UxQWe4kM= github.com/godror/knownpb v0.1.2/go.mod h1:zs9hH+lwj7mnPHPnKCcxdOGz38Axa9uT+97Ng+Nnu5s= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= From b7e4301d2865d4d2676e5a624d62a462118135e9 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 11:23:05 -0400 Subject: [PATCH 11/18] update toml Signed-off-by: Mark Nelson --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a8ee300..a107b8f 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.23.7 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets v0.12.0 - github.com/BurntSushi/toml v1.4.0 + github.com/BurntSushi/toml v1.5.0 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/godror/godror v0.48.1 github.com/oracle/oci-go-sdk/v65 v65.86.0 diff --git a/go.sum b/go.sum index 0d277e6..576e12a 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 h1:8BKxhZZLX/W github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/UNO-SOFT/zlog v0.8.1 h1:TEFkGJHtUfTRgMkLZiAjLSHALjwSBdw6/zByMC5GJt4= github.com/UNO-SOFT/zlog v0.8.1/go.mod h1:yqFOjn3OhvJ4j7ArJqQNA+9V+u6t9zSAyIZdWdMweWc= github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= From 38ed114daa3f6e4b8cd41f9fb14677b0617f0842 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 11:36:18 -0400 Subject: [PATCH 12/18] update prometheus Signed-off-by: Mark Nelson --- go.mod | 6 +++--- go.sum | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a107b8f..cd7aae0 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/godror/godror v0.48.1 github.com/oracle/oci-go-sdk/v65 v65.86.0 github.com/prometheus/client_golang v1.21.1 - github.com/prometheus/common v0.62.0 + github.com/prometheus/common v0.63.0 github.com/prometheus/exporter-toolkit v0.14.0 ) @@ -45,10 +45,10 @@ require ( golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/net v0.37.0 // indirect - golang.org/x/oauth2 v0.24.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect golang.org/x/sync v0.12.0 // indirect golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect - google.golang.org/protobuf v1.36.1 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 576e12a..d70a795 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,7 @@ github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17w github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= @@ -88,6 +89,8 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= +github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= +github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= github.com/prometheus/exporter-toolkit v0.14.0 h1:NMlswfibpcZZ+H0sZBiTjrA3/aBFHkNZqE+iCj5EmRg= github.com/prometheus/exporter-toolkit v0.14.0/go.mod h1:Gu5LnVvt7Nr/oqTBUC23WILZepW0nffNo10XdhQcwWA= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= @@ -119,6 +122,8 @@ golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -131,6 +136,8 @@ golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 917aeb4409343d56c213f1f2e62def8798250e12 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 11:59:39 -0400 Subject: [PATCH 13/18] update oci sdk Signed-off-by: Mark Nelson --- go.mod | 3 ++- go.sum | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cd7aae0..9018212 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/BurntSushi/toml v1.5.0 github.com/alecthomas/kingpin/v2 v2.4.0 github.com/godror/godror v0.48.1 - github.com/oracle/oci-go-sdk/v65 v65.86.0 + github.com/oracle/oci-go-sdk/v65 v65.89.1 github.com/prometheus/client_golang v1.21.1 github.com/prometheus/common v0.63.0 github.com/prometheus/exporter-toolkit v0.14.0 @@ -42,6 +42,7 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect + github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/net v0.37.0 // indirect diff --git a/go.sum b/go.sum index d70a795..4405e87 100644 --- a/go.sum +++ b/go.sum @@ -79,6 +79,8 @@ github.com/oklog/ulid/v2 v2.0.2 h1:r4fFzBm+bv0wNKNh5eXTwU7i85y5x+uwkxCUTNVQqLc= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/oracle/oci-go-sdk/v65 v65.86.0 h1:vFEguOYWd29j4TEy+BaQsUhMh2TPtfWRfLwQpYaU1wk= github.com/oracle/oci-go-sdk/v65 v65.86.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.89.1 h1:8sVjxYPNQ83yqUgZKkdeUA0CnSodmL1Bme2oxq8gyKg= +github.com/oracle/oci-go-sdk/v65 v65.89.1/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -114,26 +116,69 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= From f73f1a4ddd0265096379b7fb3b2eda72bfff6dc4 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 12:05:13 -0400 Subject: [PATCH 14/18] update docs to prepare for release Signed-off-by: Mark Nelson --- README.md | 2 +- changelog.md | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c237c5f..a0ae01c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Contributions are welcome - please see [contributing](CONTRIBUTING.md). | Release | Date | Changelog | |---------|----------------------|-----------------------------------------------------------------| -| 1.6.0 | March XX, 2025 | [1.6.0 Changelog](./changelog.md#version-160-march-xx-2025) | +| 1.6.0 | April 17, 2025 | [1.6.0 Changelog](./changelog.md#version-160-april-17-2025) | | 1.5.5 | March 13th, 2025 | [1.5.5 Changelog](./changelog.md#version-155-march-13-2025) | | 1.5.4 | March 3rd, 2025 | [1.5.4 Changelog](./changelog.md#version-154-march-3-2025) | | 1.5.3 | January 28th, 2025 | [1.5.3 Changelog](./changelog.md#version-153-january-28-2025) | diff --git a/changelog.md b/changelog.md index ff6426f..a255752 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,16 @@ Our current priorities are support for RAC and mutliple databases (including #84 and #89). We expect to address these in an upcoming release. +### Version 1.6.0, April 17, 2025 + +This release includes the following changes: + +- Added support for Azure Key Vault (#200). +- Updated some third-party dependencies. + +Thank you to the following people for their suggestions and contributions: + +- Brian, Damian et al. ### Version 1.5.5, March 13, 2025 From 1bfd5bfbe4a499a79eb8bb498819812d8898fcbb Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 16 Apr 2025 12:06:58 -0400 Subject: [PATCH 15/18] update docs to prepare for release Signed-off-by: Mark Nelson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0ae01c..3e08be8 100644 --- a/README.md +++ b/README.md @@ -611,7 +611,7 @@ The exporter will read the password from a secret stored in OCI Vault if you set ### Using Azure Vault -The exporter will read the password from a secret stored in Azure Key Vault if you set these two environment variables: +The exporter will read the database username and password from secrets stored in Azure Key Vault if you set these environment variables: - `AZ_VAULT_ID` should be set to the ID of the Azure Key Vault that you wish to use - `AZ_VAULT_USERNAME_SECRET` should be set to the name of the secret in the Azure Key Vault which contains the database username From e67b5fa03d4b7b361435fdcf5194453ccef88c4d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 17 Apr 2025 12:04:30 -0400 Subject: [PATCH 16/18] update TPL Signed-off-by: Mark Nelson --- THIRD_PARTY_LICENSES.txt | 95 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 87 insertions(+), 8 deletions(-) diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt index c54cb50..a482b39 100644 --- a/THIRD_PARTY_LICENSES.txt +++ b/THIRD_PARTY_LICENSES.txt @@ -578,6 +578,29 @@ Copyright 2019 Tim Heckman. All rights reserved. Use of this source code is --------------------------------- (separator) ---------------------------------- +== Dependency +github.com/golang-jwt/jwt/v5 + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) 2012 Dave Grijalva +Copyright (c) 2021 golang-jwt maintainers + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/google/uuid + +== License Type +SPDX:BSD-3-Clause--modified-by-Google + +== Copyright +Copyright 2023 Google Inc. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + == Dependency github.com/jpillora/backoff @@ -716,6 +739,18 @@ Copyright 2016 The filepathx Authors Copyright 2016-2017 The New York Times Company Copyright 2021 The Go Authors. All rights reserved. Copyright 2023 Google LLC +Copyright 2023+ Klaus Post. All rights reserved. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/kylelemons/godebug + +== License Type +SPDX:Apache-2.0 + +== Copyright +Copyright 2013 Google Inc. All rights reserved. --------------------------------- (separator) ---------------------------------- @@ -857,7 +892,18 @@ SPDX:Apache-2.0 Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. == Notices -Copyright (c) 2016, 2020, Oracle and/or its affiliates. +Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. + +--------------------------------- (separator) ---------------------------------- + +== Dependency +github.com/pkg/browser + +== License Type +SPDX:BSD-2-Clause + +== Copyright +Copyright (c) 2014, Dave Cheney --------------------------------- (separator) ---------------------------------- @@ -924,7 +970,7 @@ SPDX:Apache-2.0 == Copyright Copyright 2020 The Prometheus-operator Authors -Copyright 2024 The Prometheus Authors +Copyright 2025 The Prometheus Authors == Notices Common libraries shared by Prometheus Go components. @@ -993,6 +1039,17 @@ Copyright 2010 The Go Authors. All rights reserved. --------------------------------- (separator) ---------------------------------- +== Dependency +github.com/youmark/pkcs8 + +== License Type +SPDX:MIT + +== Copyright +Copyright (c) 2014 youmark + +--------------------------------- (separator) ---------------------------------- + == Dependency golang.org/x/crypto @@ -1096,7 +1153,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. == Copyright Copyright 2009 The Go Authors. -Copyright 2024 The Go Authors. All rights reserved. +Copyright 2025 The Go Authors. All rights reserved. == Patents Additional IP Rights Grant (Patents) @@ -1270,7 +1327,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. == Copyright Copyright 2009 The Go Authors. -Copyright 2024 The Go Authors. All rights reserved. +Copyright 2025 The Go Authors. All rights reserved. == Patents Additional IP Rights Grant (Patents) @@ -1373,7 +1430,7 @@ SPDX:BSD-3-Clause--modified-by-Google == Copyright Copyright 2024 Google Inc. All rights reserved. -Copyright 2024 The Go Authors. All rights reserved. +Copyright 2025 The Go Authors. All rights reserved. == Patents Additional IP Rights Grant (Patents) @@ -1430,8 +1487,30 @@ limitations under the License. ----------------------------------- Licenses ----------------------------------- ---------------------------------- (separator) ---------------------------------- == SPDX:Apache-2.0 +== SPDX:BSD-2-Clause + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + --------------------------------- (separator) ---------------------------------- @@ -1487,5 +1566,5 @@ SOFTWARE. === ATTRIBUTION-HELPER-GENERATED: -=== Attribution helper version: {Major:0 Minor:11 GitVersion:0.10.0-114-g3747dab9 GitCommit:3747dab92eb29c0dbe6409ffbb824b9ae3a04b87 GitTreeState:clean BuildDate:2024-05-31T13:48:06Z GoVersion:go1.21.4 Compiler:gc Platform:linux/amd64} -=== License file based on go.mod with md5 sum: 1f9ef04b4e97726da4230878cc4247bc +=== Attribution helper version: {Major:0 Minor:11 GitVersion:0.10.0-116-g2a434e4d GitCommit:2a434e4d7eea22d4dfd2d1cf04909239d05562b1 GitTreeState:clean BuildDate:2025-04-17T14:57:55Z GoVersion:go1.23.7 Compiler:gc Platform:linux/amd64} +=== License file based on go.mod with md5 sum: e3aaf1f636118d333ec243eb9788fa19 From a793f22425edc0f307ba4edce7cc90282811b905 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 18 Apr 2025 11:24:19 -0400 Subject: [PATCH 17/18] review commetns Signed-off-by: Mark Nelson --- azvault/azvault.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azvault/azvault.go b/azvault/azvault.go index 3049318..b27fe5c 100755 --- a/azvault/azvault.go +++ b/azvault/azvault.go @@ -6,6 +6,7 @@ package azvault import ( "context" "fmt" + "os" "strings" "github.com/prometheus/common/promslog" @@ -24,10 +25,15 @@ func GetVaultSecret(vaultId string, secretName string) string { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { logger.Error("Failed to obtain an Azure Credential", "err", err) + os.Exit(1) } // establish a connection to the key vault client client, err := azsecrets.NewClient(vaultURI, cred, nil) + if err != nil { + logger.Error("Failed to create Azure Secrets Client", "err", err) + os.Exit(1) + } // get the secret - empty string version means "latest" version := "" @@ -35,6 +41,7 @@ func GetVaultSecret(vaultId string, secretName string) string { resp, err := client.GetSecret(context.TODO(), secretName, version, nil) if err != nil { logger.Error("Failed to get secret from vault", "err", err) + os.Exit(1) } else { secret = *resp.Value } From ff09e294407bef85ce7813d89337c1371a31c135 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 18 Apr 2025 11:29:34 -0400 Subject: [PATCH 18/18] readme updates Signed-off-by: Mark Nelson --- README.md | 2 +- changelog.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e08be8..f396d68 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Contributions are welcome - please see [contributing](CONTRIBUTING.md). | Release | Date | Changelog | |---------|----------------------|-----------------------------------------------------------------| -| 1.6.0 | April 17, 2025 | [1.6.0 Changelog](./changelog.md#version-160-april-17-2025) | +| 1.6.0 | April 18, 2025 | [1.6.0 Changelog](./changelog.md#version-160-april-18-2025) | | 1.5.5 | March 13th, 2025 | [1.5.5 Changelog](./changelog.md#version-155-march-13-2025) | | 1.5.4 | March 3rd, 2025 | [1.5.4 Changelog](./changelog.md#version-154-march-3-2025) | | 1.5.3 | January 28th, 2025 | [1.5.3 Changelog](./changelog.md#version-153-january-28-2025) | diff --git a/changelog.md b/changelog.md index 3631e22..5b87206 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ Our current priorities are support for RAC and mutliple databases (including #84 and #89). We expect to address these in an upcoming release. -### Version 1.6.0, April 17, 2025 +### Version 1.6.0, April 18, 2025 This release includes the following changes: