feat: add Sequelize v6 integration#356
Open
jrothrock wants to merge 4 commits into
Open
Conversation
Patches Sequelize.prototype.query — the single funnel for all ORM operations — to create SQL/Query spans, matching the OpenTelemetry instrumentation-sequelize approach. Context captured per query: - db.statement: the SQL text - db.operation: SELECT / INSERT / UPDATE / DELETE (from opts.type or regex) - db.model: table name via 3-tier fallback (instance → tableNames → regex) - error: "true" if the query throws Adds ScoutContextName.DBOperation and ScoutContextName.DBModel to enum. Adds sequelize e2e tests (findAll, create, raw query, error flag). Supports sequelize v6. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Credits OpenTelemetry instrumentation-sequelize for the approach of patching Sequelize.prototype.query and using opts.type for operation extraction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RequireIntegration— zero config, no manual wrapping requiredSequelize.prototype.queryto wrap every query in aSQL/Queryspandb.statement,db.operation(SELECT, INSERT, UPDATE, DELETE, etc.), anddb.model(table name) on each spanopts.tableNames→ regex on SQLerror = "true"on the spanScoutContextName.DBOperationandScoutContextName.DBModelenum valuessequelizeandpg-hstoreto devDependenciesSupported versions
Sequelize v6 only (v7 is still in alpha).
How it compares to other APM providers
Test plan
🤖 Generated with Claude Code