Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No job metrics sent #516

Open
craig-cazoo opened this issue Nov 17, 2022 · 3 comments
Open

No job metrics sent #516

craig-cazoo opened this issue Nov 17, 2022 · 3 comments

Comments

@craig-cazoo
Copy link

Hi, I recently started using this action and was able to start sending workflow metrics easily

However, I have ran into an issue when enabling collect-job-metrics

No job metrics are being sent to datadog and I get the following warning for my workflow:

Warning: Could not get the check suite: GraphqlError: Resource not accessible by integration

Here's my workflow:

name: Track deployment workflow metrics to Datadog

on:
    workflow_run:
        workflows:
            - Deploy to dev environment
            - Deploy to test environment
            - Deploy to prod environment
        types:
            - completed

jobs:
    send_metrics:
        runs-on: ubuntu-latest
        timeout-minutes: 10
        steps:
            - uses: int128/datadog-actions-metrics@v1
              with:
                  datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
                  datadog-site: datadoghq.eu
                  collect-job-metrics: true
                  github-token: ${{ secrets.GITHUB_TOKEN }}

Do I need to enable some permissions for my github token or have I set up my workflow incorrectly?

Many thanks

Craig

@int128
Copy link
Owner

int128 commented Nov 26, 2022

This action requires checks scope for the job and step metrics.

If you are using the default token (i.e., GITHUB_TOKEN), see https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token.
If you are using your personal token or GitHub App, you may need to explicitly give the permission.

@craig-cazoo
Copy link
Author

Thanks for the response @int128. But I tried adding read and write permissions for checks but I'm still seeing the same warning and no job metrics are being sent.

Are there any other permissions that I should be adding?
I am using the default token but I believe my organisation has restricted access by default.

@uittorio
Copy link

FYI, Another issue was open about this and after some manual trial and error I've found the necessary permissions. #614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants