Skip to content

Conversation

@seemk
Copy link
Contributor

@seemk seemk commented Aug 21, 2024

Add sequelize instrumentation originally created by Aspecto.

Contains minor changes compared to the original: updated to latest semantic conventions and instrumentation package, moved the tests to assert.

@seemk seemk requested a review from a team August 21, 2024 21:04
@codecov
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

❌ Patch coverage is 94.28571% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@215c2b5). Learn more about missing BASE report.
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...s/instrumentation-sequelize/src/instrumentation.ts 94.89% 5 Missing ⚠️
packages/instrumentation-sequelize/src/utils.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2396   +/-   ##
=======================================
  Coverage        ?   89.11%           
=======================================
  Files           ?      190           
  Lines           ?     9326           
  Branches        ?     1923           
=======================================
  Hits            ?     8311           
  Misses          ?     1015           
  Partials        ?        0           
Files with missing lines Coverage Δ
packages/instrumentation-sequelize/src/utils.ts 85.71% <85.71%> (ø)
...s/instrumentation-sequelize/src/instrumentation.ts 94.89% <94.89%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seemk seemk requested a review from a team as a code owner September 18, 2024 18:43
@pichlermarc
Copy link
Member

@seemk - please update the PR with owners according to the contributing guidelines (similar situation as with #2187) if you're still planning to get this instrumentation added. Thanks! 🙂

@dyladan
Copy link
Member

dyladan commented Jul 16, 2025

This needs to be updated for the new directory structure and reviews from the proposed component owners

@seemk
Copy link
Contributor Author

seemk commented Jul 24, 2025

This needs to be updated for the new directory structure and reviews from the proposed component owners

Updated

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but it looks like .tav.yaml is missing which would break test-all-versions on main - could you please add it? 🙂 I'll add a new label in the meantime so that we can run test-all-versions on this PR.

"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"clean": "rimraf build/*",
"setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-sequelize",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-sequelize",
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-sequelize",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

"prewatch": "npm run precompile",
"prepublishOnly": "npm run compile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions to align with the latest changes in the packages regarding testing.

Suggested change
"test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
"test": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'",
"test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test",
"test-merge-coverage": "nyc merge .nyc_output coverage/coverage-final.json",
"test-services:start": "cd ../.. && npm run test-services:start postgres",
"test-services:stop": "cd ../.. && npm run test-services:stop postgres",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No containers need to be started for these tests, so I don't think these lines are necessary

});

describe('postgres', () => {
const DB_SYSTEM = 'postgres';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI controls some of the connection configs via en vars. Here is an example

https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/instrumentation-pg/test/pg.test.ts#L64-L72

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case these are test specific local strings to validate attributes, no actual connections need to be made.

@seemk
Copy link
Contributor Author

seemk commented Oct 21, 2025

Overall looks good, but it looks like .tav.yaml is missing which would break test-all-versions on main - could you please add it? 🙂 I'll add a new label in the meantime so that we can run test-all-versions on this PR.

And added .tav.yml

@haruelrovix
Copy link

With this PR, we can finally replace opentelemetry-instrumentation-sequelize which was still using @opentelemetry/api@ <v1.9.0.

Excellent work, @seemk ! 👏🏻 🎉

@pichlermarc pichlermarc self-assigned this Oct 22, 2025
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants