From 0af7673a749d398941e13eb368228612081eb9fc Mon Sep 17 00:00:00 2001 From: Alex Meijer Date: Thu, 3 Oct 2024 08:32:20 -0400 Subject: [PATCH] us PAT to commit Signed-off-by: Alex Meijer --- .github/workflows/update-manifest.yaml | 3 +++ pkg/plugins/datadog/cmd/main/main.go | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-manifest.yaml b/.github/workflows/update-manifest.yaml index ab382fc..7ca58af 100644 --- a/.github/workflows/update-manifest.yaml +++ b/.github/workflows/update-manifest.yaml @@ -9,6 +9,8 @@ jobs: update-manifest: runs-on: ubuntu-latest steps: + - name: echo actor + run: echo "actor is ${{ github.actor }}" - uses: actions/checkout@v4 with: path: ./ @@ -31,6 +33,7 @@ jobs: commit: --signoff message: 'update manifest' author_name: 'opencost-plugin-bot' + github_token: ${{ secrets.GH_PAT }} diff --git a/pkg/plugins/datadog/cmd/main/main.go b/pkg/plugins/datadog/cmd/main/main.go index 9b11b84..1aa3b8f 100644 --- a/pkg/plugins/datadog/cmd/main/main.go +++ b/pkg/plugins/datadog/cmd/main/main.go @@ -163,7 +163,6 @@ func (d *DatadogCostSource) getDDCostsForWindow(window opencost.Window, listPric if err != nil { log.Errorf("Error when calling `UsageMeteringApi.GetHourlyUsage`: %v\n", err) log.Errorf("Full HTTP response: %v\n", r) - ccResp.Errors = append(ccResp.Errors, err.Error()) } if err == nil { @@ -178,6 +177,11 @@ func (d *DatadogCostSource) getDDCostsForWindow(window opencost.Window, listPric } + if err != nil { + log.Errorf("after calling `UsageMeteringApi.GetHourlyUsage` %d times, still getting error: %v\n", maxTries, err) + ccResp.Errors = append(ccResp.Errors, err.Error()) + } + for index := range resp.Data { // each of these entries gives hourly data steps for indexMeas := range resp.Data[index].Attributes.Measurements {