Send metrics of GitHub Actions to Datadog
on:
workflow_run:
workflows:
- '**'
types:
- completed
jobs:
actions-metrics:
runs-on: ubuntu-latest
steps:
- uses: yuya-takeyama/github-actions-metrics-to-datadog-action@v0.2.0
with:
github-token: ${{ secrets.OWNER_GITHUB_TOKEN }}
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
enable-workflow-metrics: 'true'
enable-billing-metrics: 'true'| Name | Required | Default | Description |
|---|---|---|---|
github-token |
false |
GitHub API token | |
datadog-api-key |
true |
Datadog API key | |
enable-workflow-metrics |
true |
Set "true" to send workflow metrics | |
enable-billing-metrics |
true |
Set "true" to send billing metrics |
It's required when enable-billing-metrics is true.
secrets.GITHUB_TOKEN doesn't work for it.
user
Details: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-a-user
repoadmin:org
Also, the token must be created by a user who has ownership for the organization.
Details: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-an-organization
github.actions.workflow_duration
github.actions.billing.total_minutes_usedgithub.actions.billing.total_paid_minutes_usedgithub.actions.billing.included_minutesgithub.actions.billing.minutes_used_breakdown