{"id":15467009,"url":"https://github.com/masci/datadog","last_synced_at":"2025-04-05T11:07:53.658Z","repository":{"id":37925636,"uuid":"256330909","full_name":"masci/datadog","owner":"masci","description":"Send Datadog metrics, events, service checks and logs from GitHub workflows","archived":false,"fork":false,"pushed_at":"2025-03-04T17:16:59.000Z","size":429,"stargazers_count":75,"open_issues_count":0,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T10:06:17.152Z","etag":null,"topics":["actions","datadog","monitoring"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-16T21:12:02.000Z","updated_at":"2025-03-04T17:12:56.000Z","dependencies_parsed_at":"2023-10-17T11:48:12.592Z","dependency_job_id":"592a2680-22cd-447b-bb44-dd8e501f97b7","html_url":"https://github.com/masci/datadog","commit_stats":{"total_commits":44,"total_committers":6,"mean_commits":7.333333333333333,"dds":0.4545454545454546,"last_synced_commit":"969232c0d8cf4214ae6d9553b4165bddb00b42d4"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masci%2Fdatadog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masci%2Fdatadog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masci%2Fdatadog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masci%2Fdatadog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masci","download_url":"https://codeload.github.com/masci/datadog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939176,"owners_count":20857916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","datadog","monitoring"],"created_at":"2024-10-02T01:17:44.887Z","updated_at":"2025-04-05T11:07:53.639Z","avatar_url":"https://github.com/masci.png","language":"TypeScript","funding_links":[],"categories":["Building"],"sub_categories":["Workflows"],"readme":"# Datadog Action\n\n[![build-test](https://github.com/masci/datadog/actions/workflows/test.yml/badge.svg)](https://github.com/masci/datadog/actions/workflows/test.yml)\n\nThis Action lets you send events and metrics to Datadog from a GitHub workflow.\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e The action can send metrics and events to any Datadog site by setting the `api-url` param. When\n\u003e omitted, it defaults to the US endpoint: `https://api.datadoghq.com`.\n\nPlease note how `metrics` is defined as a string containing YAML code - this\nallows to send more than one metric at once if needed. To send one metric,\nconfigure a job step like the following:\n\n```yaml\n- name: Build count\n  uses: masci/datadog@v1\n  with:\n    api-key: ${{ secrets.DATADOG_API_KEY }}\n    metrics: |\n      - type: \"count\"\n        name: \"test.runs.count\"\n        value: 1.0\n        host: ${{ github.repository_owner }}\n        tags:\n          - \"project:${{ github.repository }}\"\n          - \"branch:${{ github.head_ref }}\"\n```\n\nYou can also send Datadog events from workflows, same as `metric` please note\nhow `events` is indeed a string containing YAML code. For example, an use case\nmight be sending an event when a job has failed:\n\n```yaml\nsteps:\n  - name: checkout\n    uses: actions/checkout@v2\n  - name: build\n    run: this-will-fail\n  - name: Datadog\n    if: failure()\n    uses: masci/datadog@v1\n    with:\n      api-key: ${{ secrets.DATADOG_API_KEY }}\n      events: |\n        - title: \"Failed building Foo\"\n          text: \"Branch ${{ github.head_ref }} failed to build\"\n          alert_type: \"error\"\n          host: ${{ github.repository_owner }}\n          tags:\n            - \"project:${{ github.repository }}\"\n```\n\nYou can also send Datadog service checks from workflows, same as others please note\nhow `service-checks` is indeed a string containing YAML code. For example, an use case\nmight be sending when a job has failed:\n\n```yaml\nsteps:\n  - name: checkout\n    uses: actions/checkout@v2\n  - name: build\n    run: this-will-fail\n  - name: Datadog\n    if: failure()\n    uses: masci/datadog@v1\n    with:\n      api-key: ${{ secrets.DATADOG_API_KEY }}\n      service-checks: |\n        - check: \"app.ok\"\n          message: \"Branch ${{ github.head_ref }} failed to build\"\n          status: 0\n          host_name: ${{ github.repository_owner }}\n          tags:\n            - \"project:${{ github.repository }}\"\n```\n\nYou can also send Datadog logs from workflows, same as others please note\nhow `logs` is indeed a string containing YAML code. For example, an use case\nmight be sending when a job has failed:\n\n```yaml\nsteps:\n  - name: checkout\n    uses: actions/checkout@v2\n  - name: build\n    run: this-will-fail\n  - name: Datadog\n    if: failure()\n    uses: masci/datadog@v1\n    with:\n      api-key: ${{ secrets.DATADOG_API_KEY }}\n      logs: |\n        - ddsource: \"nginx\"\n          ddtags: \"env:staging,version:5.1\"\n          hostname: \"i-012345678\"\n          message: \"{\\\"message\\\":\\\"2019-11-19T14:37:58,995 ERROR [process.name][20081] Hello World\\\", \\\"level\\\":\\\"error\\\"}\"\n          service: \"payment\"\n```\n\n## Inputs\n\n```yaml\n- name: Datadog\n  uses: masci/datadog@v1\n  with:\n    # The api key to use.\n    # Type: string\n    # Required\n    api-key: ${{ secrets.DATADOG_API_KEY }}\n\n    # The ingestion endpoint to use, US by default.\n    # Type: string\n    # Default: 'https://api.datadoghq.com'\n    api-url: ''\n\n    # The URL of the Log API endpoint.\n    # Type: string\n    # Default: 'https://http-intake.logs.datadoghq.com'\n    log-api-url: ''\n\n    # If true, timeout errors will be ignored and step will always succeed\n    # Type: boolean\n    # Default: false\n    ignore-timeouts:\n\n    # Timeout value in milliseconds for the HTTP client.\n    # Type: number\n    # Default: 30000 (30 seconds)\n    timeout:\n\n    # A list of metric objects to send, defined in YAML format\n    # Type: string\n    # Default: '[]'\n    metrics: ''\n\n    # A list of event objects to send, defined in YAML format.\n    # Type: string\n    # Default: '[]'\n    events: ''\n\n    # A list of service check objects to send, defined in YAML format.\n    # Type: string\n    # Default: '[]'\n    service-checks: ''\n\n    # A list of log objects to send, defined in YAML format.\n    # Type: string\n    # Default: '[]'\n    logs: ''\n```\n\n## Development\n\nInstall the dependencies\n```bash\n$ npm install\n```\n\nLint, test and build the typescript and package it for distribution\n```bash\n$ npm run all\n```\n\nRun the tests :heavy_check_mark:\n```bash\n$ npm test\n\n\u003e datadog-action@1.0.0 test /datadog\n\u003e jest\n\n PASS  __tests__/main.test.ts\n  unit-tests\n    ✓ api-key input param must be set (3 ms)\n    ✓ default api endpoint URL (1 ms)\n    ✓ custom api endpoint URL\n    ✓ run calls the sending functions (1 ms)\n  end-to-end tests\n    ✓ actually sends data to the backend when DD_API_KEY env var is set\n...\nRan all test suites.\n```\n\nWhen the DD_API_KEY env var is set with a valid API Key, the tests will\nalso perform an actual call sending some metrics, events and service checks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasci%2Fdatadog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasci%2Fdatadog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasci%2Fdatadog/lists"}