-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactor/test-utils-transformer-types
- Loading branch information
Showing
8 changed files
with
95 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Create or Update OpenTelemetry Update PR | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-or-update-deps-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fork | ||
run: gh repo fork open-telemetry/opentelemetry-js-contrib | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: opentelemetrybot/opentelemetry-js-contrib | ||
ref: main | ||
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} | ||
- name: Sync with upstream | ||
run: | | ||
git remote show origin | ||
git remote add upstream https://github.com/open-telemetry/opentelemetry-js-contrib.git | ||
git fetch upstream | ||
git reset --hard upstream/main | ||
git push origin main --force | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
node-version: 22 | ||
|
||
- run: npm install -g npm@latest | ||
|
||
- run: npm ci | ||
|
||
- name: Create/Update Release PR | ||
run: | | ||
git config user.name opentelemetrybot | ||
git config user.email [email protected] | ||
git checkout -b feat/update-otel-deps | ||
node ./scripts/update-otel-deps.js | ||
git commit -am "feat(deps): update deps matching '@opentelemetry/*'" | ||
git push origin feat/update-otel-deps --force | ||
gh pr create --repo open-telemetry/opentelemetry-js-contrib --title 'chore: prepare next release' --body 'Updates all `@opentelemetry/*` dependencies to latest' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,3 +146,22 @@ export const once = (fn: Function) => { | |
return fn(...args); | ||
}; | ||
}; | ||
|
||
export function getConnectionPrototypeToInstrument(connection: any) { | ||
const connectionPrototype = connection.prototype; | ||
const basePrototype = Object.getPrototypeOf(connectionPrototype); | ||
|
||
// [email protected] included a refactoring, where most code was moved out of the `Connection` class and into a shared base | ||
// so we need to instrument that instead, see https://github.com/sidorares/node-mysql2/pull/3081 | ||
// This checks if the functions we're instrumenting are there on the base - we cannot use the presence of a base | ||
// prototype since EventEmitter is the base for mysql2@<=3.11.4 | ||
if ( | ||
typeof basePrototype?.query === 'function' && | ||
typeof basePrototype?.execute === 'function' | ||
) { | ||
return basePrototype; | ||
} | ||
|
||
// otherwise instrument the connection directly. | ||
return connectionPrototype; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters