diff --git a/docs/src/pages/ops/index.astro b/docs/src/pages/ops/index.astro index c783ec05..ddea9f24 100644 --- a/docs/src/pages/ops/index.astro +++ b/docs/src/pages/ops/index.astro @@ -60,7 +60,7 @@ for (const category of allOps) {

Example

A span measuring a database query sets:

-

sentry.op = "db.query"

+

sentry.op = "db"

diff --git a/javascript/sentry-conventions/src/op.ts b/javascript/sentry-conventions/src/op.ts index b0cb6d0d..a387d595 100644 --- a/javascript/sentry-conventions/src/op.ts +++ b/javascript/sentry-conventions/src/op.ts @@ -279,12 +279,18 @@ export const UI_LIVEWIRE = 'ui.livewire'; // Description: Database related spans are expected to follow OpenTelemetry's Database semantic conventions when possible. +/** + * A database operation, such as a query or command sent to a database + */ export const DB = 'db'; +/** + * @deprecated Use {@link DB} (db) instead - Use the generic `db` op for all database operations. Describe the operation with the `db.*` span attributes instead. + */ export const DB_QUERY = 'db.query'; /** - * @deprecated Use {@link DB_QUERY} (db.query) instead - Provider-specific Redis ops are replaced by framework-agnostic ones. + * @deprecated Use {@link DB} (db) instead - Provider-specific Redis ops are replaced by framework-agnostic ones. */ export const DB_REDIS = 'db.redis'; diff --git a/model/op/database.json b/model/op/database.json index c2c4d335..2d3f0da3 100644 --- a/model/op/database.json +++ b/model/op/database.json @@ -3,15 +3,20 @@ "description": "Database related spans are expected to follow OpenTelemetry's Database semantic conventions when possible.", "fields": [ { - "name": "db" + "name": "db", + "description": "A database operation, such as a query or command sent to a database" }, { - "name": "db.query" + "name": "db.query", + "deprecation": { + "replacement": "db", + "note": "Use the generic `db` op for all database operations. Describe the operation with the `db.*` span attributes instead." + } }, { "name": "db.redis", "deprecation": { - "replacement": "db.query", + "replacement": "db", "note": "Provider-specific Redis ops are replaced by framework-agnostic ones." } }, diff --git a/rust/src/op.rs b/rust/src/op.rs index 8ea2b1dc..f3e6342f 100644 --- a/rust/src/op.rs +++ b/rust/src/op.rs @@ -175,11 +175,13 @@ pub const UI_LIVEWIRE: &str = "ui.livewire"; // Name: database // Description: Database related spans are expected to follow OpenTelemetry's Database semantic conventions when possible. +/// A database operation, such as a query or command sent to a database pub const DB: &str = "db"; +#[deprecated(note = "Use `DB` (db) instead - Use the generic `db` op for all database operations. Describe the operation with the `db.*` span attributes instead.")] pub const DB_QUERY: &str = "db.query"; -#[deprecated(note = "Use `DB_QUERY` (db.query) instead - Provider-specific Redis ops are replaced by framework-agnostic ones.")] +#[deprecated(note = "Use `DB` (db) instead - Provider-specific Redis ops are replaced by framework-agnostic ones.")] pub const DB_REDIS: &str = "db.redis"; pub const CACHE: &str = "cache";