From de9c32e8cd1317cc8fc87f71e1ae01fefd72cd43 Mon Sep 17 00:00:00 2001 From: Rob Brackett Date: Wed, 10 Sep 2025 20:11:58 -0700 Subject: [PATCH 1/3] Add integration test for Bun v1.0.x This is a follow-on to the official Deno support work in #148. --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ test-other/integration_check.mjs | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa21e4f..6c9f79d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,27 @@ jobs: run: | deno --allow-all test-other/integration_check_deno.ts + test-bun-integration: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.0.36' + + - name: Install dependencies + run: bun install + + - name: Check Integration + env: + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} + DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }} + DATADOG_SITE: ${{ secrets.DATADOG_API_HOST }} + run: | + bun test-other/integration_check.ts '-bun' + lint: runs-on: ubuntu-latest steps: diff --git a/test-other/integration_check.mjs b/test-other/integration_check.mjs index bd3f274..d57f847 100644 --- a/test-other/integration_check.mjs +++ b/test-other/integration_check.mjs @@ -6,7 +6,7 @@ import { main } from './integration_check_lib.mjs'; -main().catch(error => { +main({ tagSuffix: process.argv[2] || '' }).catch(error => { process.exitCode = 1; console.error(error); }); From bd8113197e8c3fff45d2eaa48e7e436d3ab7c434 Mon Sep 17 00:00:00 2001 From: Rob Brackett Date: Wed, 10 Sep 2025 20:16:25 -0700 Subject: [PATCH 2/3] It would help if I referenced the right file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c9f79d..4be5307 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }} DATADOG_SITE: ${{ secrets.DATADOG_API_HOST }} run: | - bun test-other/integration_check.ts '-bun' + bun test-other/integration_check.mjs '-bun' lint: runs-on: ubuntu-latest From d8dd3bcf181415ad15395daf48b83d8114ebad5a Mon Sep 17 00:00:00 2001 From: Rob Brackett Date: Wed, 10 Sep 2025 20:34:10 -0700 Subject: [PATCH 3/3] Document Bun support in README --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index abf2e93..44654b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ [![NPM Version][npm-image]][npm-url] [![Build Status][ci-status-image]][ci-status-url] [![Downloads Stats][npm-downloads]][npm-url] -![deno compatibility][deno-image] +![Supports Deno 2.1 and Newer][deno-image] +![Supports Bun 1.0 and Newer][bun-image] Datadog-metrics lets you collect application metrics through Datadog's HTTP API. Using the HTTP API has the benefit that you **don't need to install the Datadog Agent (StatsD)**. Just get an API key, install the module and you're ready to go. @@ -12,7 +13,7 @@ The downside of using the HTTP API is that it can negatively affect your app's p ## Installation -Datadog-metrics is compatible with Node.js v14 and later and Deno 2.1 and later. You can install it with NPM: +Datadog-metrics is compatible with Node.js v14+, Deno 2.1+, and Bun 1.0+. You can install it with NPM: ```sh npm install datadog-metrics --save @@ -372,13 +373,13 @@ Contributions are always welcome! For more info on how to contribute or develop **Breaking Changes:** -* The minimum required Node.js version is now v14.0.0 and Deno version is 2.1.0. +* The minimum required Node.js version is now v14.0.0, Deno version is 2.1.0, and Bun version is 1.0.0. * The `code` property on `AuthorizationError` instances has been changed to `DATADOG_METRICS_AUTHORIZATION_ERROR` for clarity and consistency (it was previously `DATADOG_AUTHORIZATION_ERROR`). If you are using `errorInstance.code` to check types, make sure to update the string you were looking for. **New Features:** -* Clarify this package is compatible with Deno (>= v2.1). We’ve silently worked on Deno for a long time, but never formally supported it before this release. +* Clarify this package is compatible with Deno (>= v2.1) and Bun (>= 1.0). We’ve silently worked on Deno and Bun for a long time, but never formally supported them before this release. **Deprecations:** @@ -800,4 +801,5 @@ Your contributions are always welcome! See [`CONTRIBUTING.md`](./CONTRIBUTING.md [npm-downloads]: https://img.shields.io/npm/dm/datadog-metrics.svg?style=flat-square [ci-status-image]: https://github.com/dbader/node-datadog-metrics/actions/workflows/ci.yml/badge.svg?branch=main [ci-status-url]: https://github.com/dbader/node-datadog-metrics/actions/workflows/ci.yml?query=branch%3Amain -[deno-image]: https://shield.deno.dev/deno/^2.1 +[deno-image]: https://img.shields.io/badge/Deno-^2.1-blue?logo=deno&color=70ffaf&logoColor=ffffff +[bun-image]: https://img.shields.io/badge/Bun-^1.0-blue?logo=bun&color=f368e0