fix(tracing): map database driver names to OpenTelemetry db.system values#1146
Open
dfinchenko wants to merge 1 commit into
Open
fix(tracing): map database driver names to OpenTelemetry db.system values#1146dfinchenko wants to merge 1 commit into
dfinchenko wants to merge 1 commit into
Conversation
dfinchenko
force-pushed
the
fix-db-system-otel-naming
branch
from
June 19, 2026 18:30
b061e2a to
cf0c12e
Compare
…lues Sentry's Queries insights filter database spans by their OpenTelemetry db.system value, which does not recognize some of Laravel's driver names (e.g. pgsql or sqlsrv), leaving the Queries table empty. Map the driver name to the OpenTelemetry value (pgsql -> postgresql, sqlsrv -> microsoft.sql_server), passing already-correct names (mysql, mariadb, sqlite) through unchanged. Fixes getsentry#1075
dfinchenko
force-pushed
the
fix-db-system-otel-naming
branch
from
June 19, 2026 18:38
cf0c12e to
d96b8b0
Compare
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.
Issue
Fixes #1075.
Database query spans set
db.systemdirectly from Laravel's driver name:getDriverName()returns Laravel's driver identifiers (pgsql,sqlsrv, …), but Sentry's Queries insights filter spans by their OpenTelemetrydb.systemvalue, which does not includepgsql. As reported in #1075, this leaves the Queries table empty on a self-hosted instance even though the per-minute/duration graphs populate.Change
Map the Laravel driver name to its OpenTelemetry
db.systemvalue before setting it on the span:db.systempgsqlpostgresqlsqlsrvmssqlmysql,mariadb,sqlite, …This matches the direction confirmed by @Litarnus in the issue. Driver names that already equal the OpenTelemetry value are passed through unchanged, so only PostgreSQL and SQL Server change.
Tests
DatabaseIntegrationTestnow asserts the mappeddb.systemfor PostgreSQL and SQL Server connections, and the existing MySQL/SQLite cases assert the passthrough value. Full suite green (composer cs-check/composer tests).Notes
switch).sqlsrvis mapped tomssql(the long-standing OpenTelemetrydb.systemvalue); happy to switch it tomicrosoft.sql_serverif you prefer the newer registry name.CHANGELOG.mdper the repo's agent guidance that it is release-managed — let me know if you'd like anUnreleasedentry added.