Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/pages/ops/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ for (const category of allOps) {
<div class="mt-6 p-4 bg-bg-elevated rounded-md border-l-[3px] border-accent">
<h4 class="text-sm text-accent mb-3">Example</h4>
<p class="text-sm mb-2">A span measuring a database query sets:</p>
<p class="text-sm m-0"><code>sentry.op = "db.query"</code></p>
<p class="text-sm m-0"><code>sentry.op = "db"</code></p>
</div>
</section>

Expand Down
8 changes: 7 additions & 1 deletion javascript/sentry-conventions/src/op.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
11 changes: 8 additions & 3 deletions model/op/database.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
},
Expand Down
4 changes: 3 additions & 1 deletion rust/src/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading