Skip to content

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Oct 16, 2024

This PR closes prisma/prisma#21472.
It applies the db.system attribute to metrics spans accoding to https://opentelemetry.io/docs/specs/semconv/database/database-spans/.

Here's the breakdown of how db.system is set for each connector:

  • provider = "postgres" → `db.system = "postgresql"
  • provider = "cockroachdb" → `db.system = "cockroachdb"
  • provider = "mysql"db.system = "mysql"
    • Note: we don't set db.system = "mariadb" at this moment.
  • provider = "sqlite"db.system = "sqlite"
  • provider = "sqlserver"db.system = "mssql"
  • provider = "mongodb"db.system = "mongodb"

Closes OTEL-237.

/integration

@jkomyno jkomyno self-assigned this Oct 16, 2024
@jkomyno jkomyno requested a review from a team as a code owner October 16, 2024 09:34
@jkomyno jkomyno requested review from SevInf and removed request for a team October 16, 2024 09:34
@jkomyno jkomyno added this to the 5.21.0 milestone Oct 16, 2024
Comment on lines 20 to 22
fn system_name(&self) -> &'static str {
self.name()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only used in query-engine/core/src/executor/execute_operation.rs.
For other metrics spans, the logic lives in:

  • provider = "mongodb": query-engine/connectors/mongodb-query-connector/src/root_queries/mod.rs`
  • SQL providers: their corresponding quaint native module.

Copy link
Contributor

github-actions bot commented Oct 16, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.040MiB 2.063MiB -23.726KiB
Postgres (gzip) 820.411KiB 824.209KiB -3.798KiB
Mysql 2.006MiB 2.034MiB -28.628KiB
Mysql (gzip) 806.506KiB 812.033KiB -5.527KiB
Sqlite 1.904MiB 1.929MiB -25.184KiB
Sqlite (gzip) 766.951KiB 770.620KiB -3.669KiB

aqrln

This comment was marked as outdated.

Copy link

codspeed-hq bot commented Oct 17, 2024

CodSpeed Performance Report

Merging #5019 will not alter performance

Comparing feat/otel-spans (a5566f3) with main (4fe298b)

Summary

✅ 11 untouched benchmarks

Copy link
Member

@aqrln aqrln 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! A couple more nits, and fix the rustfmt issue, and feel free to merge afterwards 💯

@jkomyno jkomyno merged commit 8263a1f into main Oct 22, 2024
367 of 368 checks passed
@jkomyno jkomyno deleted the feat/otel-spans branch October 22, 2024 12:27
@aqrln aqrln modified the milestones: 5.21.0, 5.22.0 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTEL spans are not recognised as spans from a database

2 participants