int128 / datadog-actions-metrics

Send GitHub Actions metrics to Datadog for developer experience
Apache License 2.0
64 stars 18 forks source link

Flag to disable rate limiting metrics #1205

Open cowboy-cod3r opened 3 weeks ago

cowboy-cod3r commented 3 weeks ago

Howdy! I'm getting the following error when attempting to use tool with github enterprise:

Error: HttpError: Rate limiting is not enabled. - https://docs.github.com/enterprise-server@3.9/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user

I guess my company has rate limiting disabled and it throws the error above when it's disabled. Is there any change we can get a flag to disable it or just catch the exception and warn that rate limiting metrics won't be captured. All of the other metrics are making it to datadog though. Reason Im bring it up is that this exception causes my metrics collection workflow to fail. Thanks!

FWIW - I did try disabling it with the metrics-patterns but still hit the error.

jobs:
    send_metrics:
        runs-on: amd-standard
        timeout-minutes: 10
        steps:
            - uses: int128/datadog-actions-metrics@v1
              with:
                  datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
                  github-token: ${{ secrets.GITHUB_TOKEN }}
                  collect-job-metrics: true
                  collect-step-metrics: true
                  metrics-patterns: |
                      *
                      !github.actions.api_rate_limit.*