Skip to content

fix(instrumentation-sequelize): do not include 'server.address' for SQLite DB spans#3436

Open
trentm wants to merge 2 commits intoopen-telemetry:mainfrom
trentm:trentm-sequelize-sqlite-memory-fix
Open

fix(instrumentation-sequelize): do not include 'server.address' for SQLite DB spans#3436
trentm wants to merge 2 commits intoopen-telemetry:mainfrom
trentm:trentm-sequelize-sqlite-memory-fix

Conversation

@trentm
Copy link
Copy Markdown
Contributor

@trentm trentm commented Mar 13, 2026

I've tweaked the instr to not include server.address / server.port
for SQLite spans, because it doesn't make sense. Before this change
it was using the SQLite filename as the server.address.
This is not discussed in DB semantic conventions.
I've asked about this in semconv Slack.

I've also corrected the connection string for a SQLite in-memory
database in the tests. The previous usage was creating an actual local
file named 'memory'.

…QLite DB spans

I've tweaked the instr to not include server.address / server.port
for SQLite spans, because it doesn't make sense. Before this change
it was using the SQLite *filename* as the `server.address`.
This is not discussed in DB semantic conventions.
I've asked about this in semconv Slack.

I've also corrected the connection string for a SQLite in-memory
database in the tests. The previous usage was creating an actual local
*file* named 'memory'.
@trentm trentm self-assigned this Mar 13, 2026
@trentm trentm requested a review from a team as a code owner March 13, 2026 21:35
@github-actions github-actions bot requested review from mhennoch, seemk and t2t2 March 13, 2026 21:36
const attributes = spans[0].attributes;
assert.strictEqual(attributes[ATTR_DB_SYSTEM_NAME], 'sqlite');
assert.strictEqual(attributes[ATTR_SERVER_ADDRESS], 'memory');
// db.namespace: I think we'd expect ":memory:" here, with the trailing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this a comment just for reviewers or was to plan to keep this?
asking because the "I think" might not be the best comment 😅

@trentm
Copy link
Copy Markdown
Contributor Author

trentm commented Mar 13, 2026

I've asked about this in semconv Slack.

https://cloud-native.slack.com/archives/C041APFBYQP/p1773437220978069

@trentm trentm requested a review from maryliag March 26, 2026 18:16
Comment on lines +346 to +348
// colon as at https://www.sqlite.org/inmemorydb.html. However sequelize
// Sequelize#config.database drops the trailing ':'.
assert.strictEqual(attributes[ATTR_DB_NAMESPACE], ':memory');
Copy link
Copy Markdown
Contributor

@seemk seemk Mar 30, 2026

Choose a reason for hiding this comment

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

This is indeed bizarre, but seems to be a bug in sequelize, where the sqlite path string is parsed as an URL: https://github.com/sequelize/sequelize/blob/v6.37.8/src/sequelize.js#L198

Since we already have a check for the database dialect, perhaps we can fix the name there as well? I.e. :memory would translate to :memory:

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.

5 participants